Professional UI Solutions
Site Map   /  Register


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 General Discussion » Regarding PNG file in toolbar buuton. Collapse All
Subject Author Date
Trupti Kasvala Mar 3, 2009 - 9:21 PM

Hello sir,
I Set PNG file in toolbar button.But if I open and close my project repeatedly then it blurs icons of that toolbar I am giving steps of setting PNG file in toolbar button in my project.
1.I have overriden OnCustomizationTreeNode() function.
2.I am adding Browse Menu to customize context menu(Icon palette) of icons.Through that menu Item I am setting PNG file path.
3.Then bmp.LoadPNGFile("file path");
4. bmp.CreateHICON();
5.Then assign icon to toolbar buuton.
It sets PNG file in button properly.But If I repeatedly open & close project then it blurs that icon.The same case occurs with bmp files also.

Waiting for your early reply.

Technical Support Mar 9, 2009 - 10:41 AM

Could you modify some of our very simple sample projects like SDI or MDI, add your PNG loading code into it and exactly the same PNG image which blurs in your project and send this modified sample project to us?

Technical Support Mar 4, 2009 - 12:56 PM

Please try to avoid using HICON handles everywhere it’s possible. We have the CExtBitmap class in Prof-UIS. It provides support for images with alpha channel and per-pixel transparency even if your application is running on Windows 95 or Windows NT 4.0. It’s handle less. It’s much better than HICON handles. The CExtCmdIcon class is just container for four CExtBitmap objects representing the normal, hovered, pressed and disabled icon images. But you need to initialize only the CExtCmdIcon::m_bmpNormal property representing icon image in the normal state. You can assign this property directly from the loaded PNG bitmap. I.e. You can simply assign one CExtBitmap object to other without creating any HICON handles.

Trupti Kasvala Mar 6, 2009 - 5:51 AM

Hello sir,

I am assigning bitmap directly.Still If I set PNG file in toolbar button bitmap then it blurs that bitmap on repeatedly opening and closing that project.The same case with icon also.Can you send code to assign .ico file and .png file to icon in function OnCu

Waiting for your early reply.