Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MDI: Semitransparent Child Windows?

Status
Not open for further replies.

gianpieroriva

Programmer
Apr 2, 2004
1
IT
Hi everybody!
How can I implement an MDI application with the child windows semitransparent?

Ok, I’m going to explain myself better...
I have implement an MDI application under MFC.
Briefly I have to make my application to do what you can see at:


There you can find a screen shot of my application. How you can observe there are two child windows (in this example, but in general there could be more) displaying each one a bitmap. For each child window the user can set a transparency value (an alpha value) so that, putting that window on another he can compare the two images (medical interest). Obviously what you see in the screen shot is a fake example (otherwise I would not be here:): in this example the “sunset” bitmap has a 70% of opacity and the “bmw” bitmap has 100% o opacity; as you can see the “sunset” window is focused and lays above the “bmw” window. I made this fake example first sizing and positioning the two windows, then I minimized them and I restore the “bmw” window first and then the “sunset” window. But, if I move the windows they not repaint themselves properly. In fact I had subclassed the OnEraseBkgnd and the OnPaint of my child windows and then I had used the AlphaBlend method to paint the bitmap (I’ll have to subclass also the OnMove when a child window hasn’t 100% opacity value). The problem is that on moving, sizing and so on, before repainting with the AlphaBlend method I need to repaint what lays under the focused child windows that is moving, sizing and so on. This means that I had to repaint the parent window (the MDI container) and eventually the sibling windows (the other MDI children) in the moving child client area...
But I don’t know how to do this!

Is there anybody able to help me?
Thank You in advance for all Your answers!

Gianpiero Riva
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top