Sign in to follow this  

Blitting a buffer with win32api BitBlt?

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

I have a buffer of longs, that represent pixel colors, can I create a DC with the data inside the buffer and blit it with BitBlt?

Share this post


Link to post
Share on other sites
In windows, the way to get direct pixel access to something is through a DIBSection. First, you use CreateDIBSection to make essentially a 'blank bitmap', then you fill it using the pointer you get, then1 you create a DC, select the DIB into it (you get a bitmap handle when you create it) and then you can BitBlt from that DC to any other.

[1] There are functions to blit directly from DIBs, but I've found them to be extremely buggy even in Windows XP. There are numerous MS Knowledge Base entries covering those functions, and I also had problems not listed there but mentioned numerous times on the internet by other people trying to use the functions.

Share this post


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