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 » Icon editor Collapse All
Subject Author Date
Chris Anderson May 17, 2007 - 7:12 PM

How can I extend the icon editor sample to handle saving the changes done to the icons/bitmaps displayed in the icon editor dialog?

Chris Anderson May 21, 2007 - 9:49 AM

The first approach didnt make any difference and the second option is not really an option for us since we do not have control over the images that will be edited using the icon editor dialog. Also what would be the approach when saving .ico files?

Technical Support May 21, 2007 - 12:27 PM

The .ICO file format contains several bitmaps and Windows uses automatically one of them which is closest to the currently set display mode. But the modern .ICO format of Windows XP uses 32-bit .PNG images with alpha channel. All the modern Microsoft applications are using customizable UI where you can edit toolbar/menu icons and only one bitmap image is available when you editing icon. We are using CExtBitmap images in Prof-UIS (the CExtCmdIcon class is also based on CExtBitmap) and never HICON handles. So, there are no APIs for saving ICO format available in Prof-UIS. We recommend you switch to using 32-bit images with alpha channel. You can use either the BMP or PNG format.

Chris Anderson May 18, 2007 - 2:56 PM

I sent the source and destination bitmaps via email with some additional questions.

Technical Support May 21, 2007 - 8:48 AM

The initial bitmap is 4 bits per pixel (16 colors). The final bitmap is 32 bits per-pixel (16 million colors). We think the problem may be caused by loading the initial bitmap. You can solve this problem in one of two ways:

1) Use true in the bMake32 parameter when calling CExtBitmap::LoadBMP_File().
2) Use the 32 bit per pixel format in the original bitmap.

The second approach should definitively solve the problem.


Chris Anderson May 18, 2007 - 12:08 PM

Yes it is a 32-bit bitmap.

Technical Support May 18, 2007 - 1:37 PM

Could you send us the source and destination bitmaps?

Chris Anderson May 18, 2007 - 9:19 AM

This will handle both icons and bitmaps? What APIs would I use to write this information back. I tried using SaveBMP_File but it seems there is a loss of information from the bitmap. Any suggestions?

Technical Support May 18, 2007 - 11:20 AM

To answer you question, please let us know what bitmaps you are using? 32-bit bitmaps?

Technical Support May 18, 2007 - 7:00 AM

You can achieve this by using a CExtIconEditDlg-derived class in which clicks on the IDOK button are handled in the OnOK() virtual method. The CExtIconEditDlg::m_wndIconEditor property represents the CExtImageEditWnd control which contains the edited image.