Sign in to follow this  

[Win32] Alpha Blending without AlphaBlend()

This topic is 2621 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey,

Just wondering if its possible to do Alpha Blending with WS_CHILD windows without the use of the AlphaBlend() function. I'd like to implement my own alpha blending functions as I am doing my own custom drawing techniques, but I've run into a bit of a snag with blending between controls. I've tried using GetDIBits to pull the bits below, but that yields strange results. I might be doing something wrong in that case because I've assumed the format is ARGB (32 bit), but it appears to be different.

Anyone else fiddled around with something along these lines, or will I have to cut my losses and use the AlphaBlend function?

Thanks in advance!

Share this post


Link to post
Share on other sites
Not sure if it's relevant to what you are doing, but you can set the transparency of a window by setting the WS_EX_TRANSPARENT style and calling SetLayeredWindowAttributes() with LWA_ALPHA.

Share this post


Link to post
Share on other sites
Well what is it exactly that you want to do?

Do you want to alpha blend a window with any windows behind it such that it appears semi-transparent? In that case, SetLayeredWindowAttributes will do the trick. Even if you just want to blend child windows within your application's window i think you could still use SetLayeredWindowAttributes.

Or are you attempting to implement your own GUI framework and render the windows yourself?

Share this post


Link to post
Share on other sites

This topic is 2621 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this