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 » Controls shown transparently on a Picture Collapse All
Subject Author Date
Ian Hollamby Aug 4, 2008 - 11:18 AM

We have an application where we need to show standard windows controls on top of a bmp or png file in a dialog or view. We would like the background of controls like labels, radio buttons, checkboxes and group boxes to be transparent (ie show picture through them) We are using V2.83 of ProfUIS in the Obsidian theme.

We have tried to put a picture control as the first in the tab sequence and add controls with the WS_EX_TRANSPARENT sytle to this, the SubclassAllControlsDynamically function was called on initialisation so all controls should be subclassed as the CExt... versions, including the picture control. However the background of the controls labels, radio buttons and check boxes obscure the picture, the group boxes were not even shown on top of the picture.

Could you let us know how to obtain this result and/if this is not possible using standard ProfUIS controls?

What control should we be using for loading in a picture, is it the same as MFC, a static with SS_BITMAP or is there a better way? The CExtImageEditWnd class is a bit too heavy, but ideally we would like native import of png files if possible.

Of course needless to say speed of painting is essential...


Technical Support Aug 14, 2008 - 2:25 PM

You should use the approach used in the TabbedBars sample application (inherited background painting). It’s possible to the paint background of some window, including a dialog, and the drawn background will be inherited by child windows. First of all, you should invoke the following code to turn the inherited background painting feature on:

g_PaintManager->m_bCustomBackgroundInheritanceEnabled = true;

This code should be invoked both at startup and after selection of a new paint manager. If the inherited background painting feature is turned on, the CExtPaintManager::g_nMsgPaintInheritedBackground message is sent to all the windows and allows you to paint a solid background shared between parent/children windows. This message is handled in the TabbedBars sample where you can turn on the a hurricane-like background in the main frame window and a consistent gradient background in dialog windows inserted as pages into a One Note tab page container window.

As for the picture control you can use either the standard MFC’s CStatic class or its Prof-UIS enhanced version CExtLabel.

There is also a CExtImageEditWnd class that allows you to show and edit bitmap images and/or icons. It includes a set of drawing tools and undo/redo feature support. You can use this control in the read-only mode to have the CExtImageEditWnd window as an image viewer only. Just create it with the __EIEDWS_READONLY style to disable editing.

As for loading the PNG files there is a CExtSkinBitmap class in the ProfSkin library that loads PNG images. So you can use this library or any other you can find over the internet.