Win32 RGB fallback buffer

I have an array of RGB values ​​that I can guarantee to fit the client area of ​​the window on the screen.

Using the Win32 API, what are the simplest and fastest ways to get the contents of my array on screen in response to a WM_PAINT message?

If it makes things easier / faster, we can assume that this is a 32-bit display, and each element of the array is 32 bits.

0


source to share


2 answers


If you have complete control over the backup format, use the DIB format and the dummy BITMAPINFO structure. Then use SetDIBitsToDevice to copy to DC.



Remember the peculiarities of the DIB format - each line must be expanded to a multiple of 4 bytes, the first line of the buffer is the bottom line of the image, and the byte order is blue, green, red.

+1


source


Use BitBlt



0


source







All Articles