Sign in to follow this  
Madhed

UpdateLayeredWindow & DIBSection

Recommended Posts

Madhed    4095
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
Madhed    4095
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

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