bucherb
Messages postés412Date d'inscriptionlundi 26 mai 2003StatutMembreDernière intervention13 août 2007
-
17 janv. 2005 à 10:35
bucherb
Messages postés412Date d'inscriptionlundi 26 mai 2003StatutMembreDernière intervention13 août 2007
-
20 janv. 2005 à 11:09
Hello!
Est-ce que qqun saurait comment faire pour définir le point chaud (hot spot) d'un curseur qu'on crée soit-même dans le code..... Par défaut il est au centre...
> I'm trying to create cursors "on the fly" as it were, by creating an
> in-memory bitmap, painting on a graphics object derived from the bitmap, and
> obtaining an Icon handle from the bitmap which is then used to create the
> cursor.
<code snipped>
> This gives me a 32x32 pixel cursor showing a blue box with a nice shadow.
> The problem is that I haven't been able to set the hotspot on the cursor in
> any way.
>
> So if anybody knows how to set the hotspot on a cursor, I'd be good to go.
> Just keep in mind that I need to create the cursor images on the fly...
I don't see anything in the Cursor class information in the MSDN about how to set the hotspot of a cursor, so here's the GDI method:
1) Call GetIconInfo() on the cursor handle (h) to fill an ICONINFO structure
2) Set the xHotspot and yHotspot members of this structure
3) Call CreateIconIndirect() passing back in the ICONINFO structure
4) Call DeleteObject() on the original cursor handle to clean up the GDI resources.
Hope this helps,
cs_coq
Messages postés6351Date d'inscriptionsamedi 1 juin 2002StatutMembreDernière intervention 2 août 2014101 17 janv. 2005 à 12:16
Tu vas devoir passer par les API et recréer un curseur à partir du tiens je crois.
J'avais vu une explication il n'y a pas très longtemps, je la recherche.