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 » CExtIconEditDlg questions Collapse All
Subject Author Date
Hans Bergmeister Aug 9, 2007 - 7:50 AM

Hello,

I have several questions regarding CExtIconEditDlg:

We want to use CExtIconEditDlg as the editor to edit bitmaps with transparent background. We have managed to integrate the dialog into our application, but have a few open questions:

1.
The color palette always shows the colors already used in the bitmap. But we also want to give the user the opportunity to add more colors to the image, too. What do we have to do to get CExtIconEditDlg to show a palette with more colors than already contained in the image?

2.
Additionally to the colors contained in the palette the user should have the opportunity to add custom colors by means of a color picker (if available) or a color selection dialog. Does CExtIconEditDlg provide such feature?

Technical Support Aug 9, 2007 - 12:07 PM

You should use a CExtIconEditDlg-derived class which implements the OnInitDialog() virtual method. This method should invoke the parent class method and then modify the content of the CExtIconEditDlg::m_wndColorPalette color palette window.

Hans Bergmeister Aug 9, 2007 - 12:46 PM

Hello,

in the meantime we overloaded OnInitDialog and load a custom color array into the color palette window. This raises the next question:

We use a blueish grey color as transparent color in our bitmaps and cannot change this. We successfully set this color as transparent in the editor and preview window of the dialog by calling
dlg.m_icon.AssignFromHBITMAP(hBitmap, color);
where color is our own transparent color.

However, the color palette window comes up with the colors as specified in the color array, but "Pink" (RGB(255, 0, 255) is missing in the palette. Instead "Pink" is replaced by the palette button, that normally stands for the transparency color. What is wrong?

Question 2. is still open. Does CExtIconEditDlg provide a feature to allow the customer to edit the palette colors?