> are blended over other windows. > I found this: > 1. Create WS_POPUP window with WS_EX_LAYERED style. > 2. Create a 32 bit DIB Section using CreateDIBSection() function and > select it to any compatible DC. It will be an offscreen plain to > render window contents to. > 3. Render window contents, preserving the alpha channel. > 4. Call UpdateLayeredWindow() function to draw the window to screen.
What I am still unclear on is whether a _per-pixel_ alpha channel is applied to the blending with the window(s) below the translucent one by UpdateLayeredWindow. UpdateLayeredWindow has one alpha value as a parameter. How is it combined with the alpha values in the DIB? Or are the alpha values in the RGBQuads in that DIB even used by UpdateLayeredWindow? Right now, PowerPro uses SetLayeredWindowsAttributes for translucent bars. Its unclear to me whether I need to change this. What I am planning to do with GDI+ Image and Graphics classes to draw buttons on a bar is as follows: 1. Get the DC for bar (from Paint message) and use it to create a GDI+ Graphics object. 2. Use a Graphics.Draw... function to paint the bar background color onto the Graphics object. 3. Paint any Image assigned to the bar background (possibly PNG with alphas) onto the Graphics object, thus blending in with the background color. 4. For each button: Paint any button background color; if there is none, do not do this step. 5. Paint the button png onto its rectangle in the bar. If the button has a background color, it will be blended with that; else it will blend with what ever was previously drawn for the whole bar. (It may be that steps 2 and 3 can be combined with a single Graphics.Draw... I am not sure and need to research. Same for 4 and 5.) (Steps 2 and 3 are actually do in response to WM_ERASEBKGND). The above combines the available colours and images on the PowerPro bar. Now what I don't understand is how this is going to be drawn to the actual screen by GDI+, (note that the basic Graphics object at the start is based on an HDC for a layered window). Will it do per- pixel blending with the windows underneath or will it use the single alpha from SetLayerWindowsAttributes? And will this change if I use UpdateLayeredWindow. (I am not clear where UpdateLayeredWindow fits with GDI+ either -- would I need to do this as a separate call in plain GDI? I have to research that one if you tell me UpdateLayeredWindows attributes does per pixel blending with background.) Attention: PowerPro's Web site has moved: http://www.ppro.org Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/power-pro/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
