Page 1 of 1

I need help to convert bmp to icon

Posted: Thu Sep 18, 2003 6:51 pm
by Denis
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.

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

Posted: Thu Sep 18, 2003 7:18 pm
by freak
Try this one:
viewtopic.php?t=7478

Timo

Posted: Thu Sep 18, 2003 7:23 pm
by Denis
Thanks Freak for your fasteeeeeeeeeeeeeeeeeeeeeeeeer answer ! :wink:

I'll take a look quickly.

Denis