I need help to convert bmp to icon
Posted: Thu Sep 18, 2003 6:51 pm
Hi all,
i'm trying to convert bmp to icon to add these bitmap to an imageList wich is allready set with some icons.
I use loadimage() to get Hwnd of bitmap image.
This following code runs but ...
Image2 is result of loadimage() using bitmap file.
but when i use the imagelist with a listicongadget, the images (bmp converted to icon) don't appear correctly. They appear spotted or scored.
Thanks for help.
Denis
i'm trying to convert bmp to icon to add these bitmap to an imageList wich is allready set with some icons.
I use loadimage() to get Hwnd of bitmap image.
This following code runs but ...
Image2 is result of loadimage() using bitmap file.
Code: Select all
Hwnd_DC = CreateCompatibleDC_(0)
If Hwnd_DC And Image2
GetObject_(Image2 , SizeOf(Bitmap), @bmp.bitmap)
hBitmap = CreateCompatibleBitmap_(Hwnd_DC, bmp\bmWidth,bmp\bmHeight)
icon.IconInfo\fIcon = #TRUE
icon\hbmColor = Image2
icon\hbmMask = hBitmap
hIcon2 = CreateIconIndirect_(@icon)
DeleteObject_(hBitmap)
EndIf but when i use the imagelist with a listicongadget, the images (bmp converted to icon) don't appear correctly. They appear spotted or scored.
Thanks for help.
Denis