Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Add png picture tool toobar button and menu item Collapse All
Subject Author Date
steven frierdich Jun 15, 2006 - 5:15 PM

Is there any simple way to add a png picture tool a toolbar button and also a menu item?
Any source code to how to do this?

Technical Support Jun 17, 2006 - 11:10 AM

You cannot add a PNG image to a toolbar button or a menu item directly. Here are two ways to workaround this issue.

1. Use some image editor to convert a PNG image to a 32-bit bitmap with alpha channel. After that you can use it as an ordinary bitmap. The CExtToolControlBar::LoadToolBar() method supports loading of 32-bit bitmaps and the CExtCmdManager::UpdateFromToolBar() method allows you to update the command manager with 32-bit toolbar images. This approach is used in the FunnyBars sample. The Vista Icons toolbar and Vista Icons menu demonstrate how 32-bit images can be used in toolbars and menus.

2. Use the ProfSkin library, which allows you to directly load images of PNG format. Please note that the ProfSkin library depends on the LibPNG and Zlib libraries, which included into the Prof-UIS workspace. So before compiling the ProfSkin library, please compile these libraries first. The ProfSkin library uses a CExtSkinBitmap class which implements API for loading/saving images of PNG format. So, you can simply use the CExtSkinBitmap class for loding PNG images directly in this case.