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 » Background not being erased Collapse All
Subject Author Date
Robert Webb Jul 6, 2010 - 8:47 PM

Our dialog has a bitmap, which we change depending on options chosen (using CExtLabel::SetBitmap()).  The bitmap has transparency.  Before Prof-UIS the background behind the bitmap was erased first, so the new image would appear properly.  Now it is not erased, so parts of the previous bitmap show through in the transparent parts of the new bitmap.


I’m sure I saw a post or article about how to fix this already, but I can’t find it.  Can you point me to it again or tell me the best way to fix this?


Thanks,


Rob.

Technical Support Jul 16, 2010 - 12:10 PM

The CExtResizableDialog and CExtResizablePropertyPage classes are very recommended to use with the WS_CLIPSIBLINGS|WS_CLIPCHIDLREN standard window styles. The WS_CLIPSIBLINGS style makes the child dialog isolated from other windows in the same window container (CExtResizablePropertySheet, CExtTabPageContainerWnd, other). The WS_CLIPCHIDLREN style makes each dialog control isolated and not intersecting with other controls. Prof-UIS common controls classes always draw their themed backgrounds via paint manager. These backgrounds are always consistent with the parent dialog window background. The pixels of dialog surfaces are never used by its children controls. This means you should redraw the label window - not a rectangular part of its parent dialog window.
The CExtLabel control supports the 32-BPP transparent CExtBitmap bitmaps on any Windows OS starting from Windows 95/NT 4.0. You can assign it using the CExtLabel::SetBitmapEx() method and specify painting mode using the CExtLabel::SetImageMode method.

Robert Webb Jul 18, 2010 - 8:17 PM

I tried adding the WS_CLIPSIBLINGS|WS_CLIPCHIDLREN styles to my pages, but they made things worse.  First, I’m not sure where to add them.  The earliest time I could find was in OnInitDialog().  Once added, the window updating became worse.  Not only did changing the bitmap of a label leave trash behind in the transparent parts, but now if I drag the dialog partly off-screen and back on again, the transparent parts in my label’s bitmap again end up full of trash (echoes of other parts).


My work-around of invalidating the label’s rectangle works, albeit a bit slow on-screen for some reason.  So I guess I’ll stick with that.


Thanks,


Rob.

Technical Support Jul 19, 2010 - 7:38 AM

Please set both the Clip Siblings and Clip Children properties of the dialog template resource on. Then please check all the group boxes and static frame rectangle controls on your dialog template resource. The Z order of these controls should be greater the Z orders of all the controls inside them.
The window invalidating just delays the window repainting. Please invoke the UpdateWindow() API to make the bitmap label control repainted immediately.

Technical Support Jul 7, 2010 - 7:19 AM

Painting a bitmap background over a dialog can be used with windows common controls. Your dialog should not be resizable and it should not clip children. The common controls will inherit a dialog background. This will not work with Prof-UIS. Prof-UIS controls perform themed background painting through the paint manager. Prof-UIS dialog are typically resizable and require children clipping.
We have an inherited background painting feature. It can be seen in the TabbedBars sample application. The one note tab page container with blue, yellow and green tabs is created as main SDI view window in this sample application. It uses the resizable dialogs with inherited gradient backgrounds as tab pages. You can check all the check boxes in the third green tab and you will see another version the inherited background everywhere.
Please read the following:
http://www.prof-uis.com/prof-uis/tech-support/general-forum/how-to-set-background-image-on-dialog-65196.aspx#65198
http://www.prof-uis.com/prof-uis/tech-support/faq/miscellaneous.aspx#how-to-paint-a-custom-background-consistent-between-the-windows-in-my-application
http://www.prof-uis.com/prof-uis/tech-support/general-forum/custom-background-colour-for-cextresizabledialog-54409.aspx
http://www.prof-uis.com/prof-uis/tech-support/general-forum/how-to-change-background-color-of-a-modeless-dialog-box-64189.aspx
http://www.prof-uis.com/prof-uis/tech-support/general-forum/handling-wm_paint-message-for-cextresizabledialog-61578.aspx

Robert Webb Jul 15, 2010 - 8:30 PM

Hi,


We’re not trying to draw a bitmap in the background, nor do anything with the background.  We just want to leave it as default for the current theme.  What we want to do is change the bitmap being displayed in a CExtLabel control.  Our bitmap has transparency, and in the transparent parts the underlying dialog’s background is not redrawn as it was before we used ProfUIS.


I have solved this now by getting the rectangle of our control and invalidating that rectangle in the dialog window, forcing it to redraw its background.  I just would have thought that the ProfUIS dialog should redraw its background properly by default, as it would in MFC.  But for now, problem solved.


Thanks,


Rob.