Jump to content
  • Advertisement
Sign in to follow this  
Madhed

UpdateLayeredWindow & DIBSection

This topic is 3935 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

Hi there. Well lets jump right in... I have build a program that displays an alpha blended Dialog in windows using UpdateLayeredWindow. Everything worked until yesterday when I had to change my Desktop's color depth to 16bit. But that's not really the problem. I found out pretty quick that I used a compatible bitmap for updating which, since I now only have 16 bits, doesn't contain alpha information. I realised that I had to use a DIB with 32bit to store the Graphics updates and assign it to a DC. dib = CreateDIBSection(....); HDC dc = CreateCompatibleDC(NULL); SelectObject(dc, dib); This works. But calling UpdateLayeredWindow() with the dc into which the dib is selected the call just fails and GetLastError() returns 0. O_o It doesn't work either in 16bit nor in 32bit video mode. But It worked before with a device dependent bitmap, only in 32bit mode. Please help me... this is really frustrating. Am I doing something fundamentally wrong? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Actually I got it working now.
I just exchanged all MFC calls and classes with their respective GDI counterparts.
Seems like MFC doesn't like DIBs... hm.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!