Manipulating bitmap images

For my project (using winapi) I have to be able to manipulate bitmaps and images.
Is there a way or a library that I could use to paint 1 bitmap over another? Also I need one color to be ignored when painting 1 bitmap over another, like a transparent color.
When using winapi I can only display bitmaps, how would I read other types of images and convert them to bitmap images?
And I'd like to rotate the bitmap images. Any idea how to do that?
All of this is trivial with a graphic lib. If this is for a game or something, you should consider leaving WinAPI and getting a lib like SFML which not only does all of this effortlessly, but also is cross-platform, and actually performs better (faster drawing).


Though if you want to stick with WinAPI... there are two libraries that are available (that I know of). Unfortunately, I only really have experience with one of them:


WinGDI is the basic interface for graphical output in Windows programs. In has things like BitBlt which allows you to copy and draw images, has ways to load images, and other such basic functionality. Unfortunately, it's not much more than bare-bones. AFAIK it doesn't have a way to load anything other than .bmp out of the box and doing something like image rotation has to be done by hand. This is the only form of direct graphics output on Windows that I have a decent amount of first-hand experience with... and having that experience all I can say is: don't bother... it's usually not worth using.


GDI+ is a more modern, more "C++ friendly" version of WinGDI... and it adds a lot of new functionality and should be able to do most if not all of what you want. Unfortunately I know very little about it so I can't really direct you any more than to say "look up some GDI+ tutorials"
I've used sfml before and know it can do this. This is just a part of one of my project, nothing that important. And I tried bitblt but it doesn't have the performance I need. Donno about git+, maybe I check it out. Thanks anyway
You can use Windows Imaging Component to load just about any image format, and Direct2D for "modern" 2D graphics rendering. The latter is either part of or backed by DirectX to achieve hardware acceleration, so it's really the best 2D API on Windows(besides DirectX itself or OpenGL).

Both are COM API's so there might be a bit of a learning curve if you've never used COM before.

Windows Imaging Component:
http://msdn.microsoft.com/en-us/library/windows/desktop/ee719902%28v=vs.85%29.aspx

Direct2D:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd370990%28v=vs.85%29.aspx

Direct2D how-to guides:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd756671%28v=vs.85%29.aspx


Those look like useful tools. I'll try to implement it to my project.

But first I'll try making something with what I already have :)
Topic archived. No new replies allowed.