Skip to main content
added 2 characters in body
Source Link
Remy Lebeau
  • 580.4k
  • 32
  • 483
  • 812

First off, you can't use LoadImage() to load a PNG image.png file as an HBITMAP. See questions like How would I load a PNG image using Win32/GDI (no GDI+ if possible)? and How would I draw a PNG image using LoadImage and StretchDIBits? for alternatives.

Second, once you do have your image loaded as an HBITMAP (or HICON), you can assign it to the button using the BM_SETIMAGE message.

First off, you can't use LoadImage() to load a PNG image as an HBITMAP. See questions like How would I load a PNG image using Win32/GDI (no GDI+ if possible)? and How would I draw a PNG image using LoadImage and StretchDIBits? for alternatives.

Second, once you do have your image loaded as an HBITMAP (or HICON), you can assign it to the button using the BM_SETIMAGE message.

First off, you can't use LoadImage() to load a .png file as an HBITMAP. See questions like How would I load a PNG image using Win32/GDI (no GDI+ if possible)? and How would I draw a PNG image using LoadImage and StretchDIBits? for alternatives.

Second, once you do have your image loaded as an HBITMAP (or HICON), you can assign it to the button using the BM_SETIMAGE message.

Source Link
Remy Lebeau
  • 580.4k
  • 32
  • 483
  • 812

First off, you can't use LoadImage() to load a PNG image as an HBITMAP. See questions like How would I load a PNG image using Win32/GDI (no GDI+ if possible)? and How would I draw a PNG image using LoadImage and StretchDIBits? for alternatives.

Second, once you do have your image loaded as an HBITMAP (or HICON), you can assign it to the button using the BM_SETIMAGE message.