I need help to convert bmp to icon

Everything else that doesn't fall into one of the other PB categories.
Denis
Enthusiast
Enthusiast
Posts: 779
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

I need help to convert bmp to icon

Post 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
A+
Denis
freak
PureBasic Team
PureBasic Team
Posts: 5946
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Try this one:
viewtopic.php?t=7478

Timo
quidquid Latine dictum sit altum videtur
Denis
Enthusiast
Enthusiast
Posts: 779
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Post by Denis »

Thanks Freak for your fasteeeeeeeeeeeeeeeeeeeeeeeeer answer ! :wink:

I'll take a look quickly.

Denis
A+
Denis
Post Reply