Blitting a buffer with win32api BitBlt?

Started by
0 comments, last by Extrarius 19 years, 6 months ago
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?
How appropriate, you fight like a cow!
Advertisement
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.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk

This topic is closed to new replies.

Advertisement