Jump to content

  • Log In with Google      Sign In   
  • Create Account

[Win32] Alpha Blending without AlphaBlend()


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 enigmatix   Members   -  Reputation: 144

Like
0Likes
Like

Posted 12 October 2010 - 06:37 AM

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!

Sponsor:

#2 XTAL256   Members   -  Reputation: 103

Like
1Likes
Like

Posted 12 October 2010 - 12:28 PM

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.

#3 enigmatix   Members   -  Reputation: 144

Like
0Likes
Like

Posted 12 October 2010 - 02:45 PM

Hmmm, yeah, not sure either, but I'll look into that.

#4 XTAL256   Members   -  Reputation: 103

Like
0Likes
Like

Posted 12 October 2010 - 04:21 PM

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?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS