Icon laden und Pointer bekommen
-
Hallo zusammen,
ich möchte aus einer .exe das Icon auslesen und als Textur benutzen.
Für das Laden der Texturen verwende ich den Texture Manager (http://members.iinet.net.au/~cleathley/openGL/TextureLoader.htm). Damit ist es möglich .ico Dateien direkt als Textur zu verweden.
Der Aufruf lautet:
LoadTextureFromRam(unsigned char *pData, int Length, glTexture *pglTexture, eglTexType TexType) pData Pointer to a memory location which contains the Raw Binary data of an Image file. Length The Length of the Raw Binary data. pglTexture Pointer to a glTexture structure which will be populated on return with the Texture ID to use for openGL. eglTexType Defines the Image format type of the data pointed to by pData. Valid values are; txBmp, txGif, txJpg, txIco & txTga. This must be of the correct type for this command to work.Das Icon lade ich mit:
HICON hIconSmall; ICONINFO IconInfo; ExtractIconEx((LPCTSTR)"c:\polsuche.exe", 0, NULL, &hIconSmall, 1); GetIconInfo(hIconSmall, &IconInfo);Wie bekomme ich aber jetzt den Pointer auf die Rohdaten im Speicher und die Länge?
Gruß
Alex
-
In der IconInfo Strucktur von GetIconInfo hast du doch schon mal die Bitmap, und wenn du damit nicht weiter kommst, kannst du es ja mal mit LoadResource versuchen.
Gruß Matthias