Sign in to follow this  

C++ and Windows GDI Questions (Resolved)

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

The first question is about the 'AlphaBlend' function. In this project I am using Windows XP Home Editon (SP2), Dev-C++ 4.9.9.1, DirectDraw and Windows GDI. When I compile, it says that the function is undeclared, but I have included the "windows.h" file and "wingdi.h" (though it is included in "windows.h"). Here is the exact error: "`AlphaBlend' undeclared (first use this function)". It does not say anything about function prototypes. I don't understand, the BitBlt function works perfectly. I'm not sure, but does the problem deal with the fact that the bitmap is 24-bit instead of 32-bit? (SOLVED) My second question is about Bitmaps. How do you generate a handle for a bitmap? If no one knows, then does someone know how the handles work? (SOLVED) [Edited by - deadimp on December 29, 2004 9:15:05 PM]

Share this post


Link to post
Share on other sites
Thanks! It ends up I had to do a little more tweaking though... For some reason, the "wingdi.h" file had this macro surrounding a few functions (including AlphaBlend):
Line 2871: "#if (WINVER>= 0x0500)"
I'm not sure what exactly the problem was... Oh well, it works now.

Share this post


Link to post
Share on other sites
That macro exists because AlphaBlend() only exists on some versions of Windows.

You can get a handle to a bitmap in a number of ways, either through CreateBitmap() or CreateCompatibleBitmap() if you're going to dynamically create the image, CreateDIBSection() if you wont device independent, or LoadImage() if you want to load it from a file or resource.

Share this post


Link to post
Share on other sites

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