PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Wilko Verweij on March 25, 2015, 07:16:23 PM

Title: PNG-files in menu?
Post by: Wilko Verweij on March 25, 2015, 07:16:23 PM
Hi, I would like to display PNG-files in the menu of a program. In the past I used icons so I know how to make a menu owner-drawn and display the icon with the DrawState method. I figured out how FireFly displays PNG-files (basically a static control, saving it as resource and using GDI+ to display) but I can not figure out how to apply that method to a menu. Am I missing something or should I go a different path?
Any help is appreciated,
Wilko
Title: Re: PNG-files in menu?
Post by: Paul Squires on March 26, 2015, 11:23:55 AM
Hi Wilko, I have never tried using PNG files in menus but I agree that you are headed in the right direction by using GDI+ to do the conversion. I would save the PNG in the resource file and use one of Jose's GDI wrappers to do the conversion to bitmap or icon:
GdiPlusCreateBitmapFromRawDataResource
GdiPlusCreateHICONFromResource
(found in Jose's GdipUtils.inc include file)