I have an array of RGB values, whose size I can guarantee to match the client area of a window on screen.
Using the Win32 API, what are the easiest and fastest ways to get the contents of my array on the screen in response to a WM_PAINT message?
If it makes it simpler/faster, we can assume it’s a 32-bit display and each element of the array is 32 bits.
If you have complete control over your backing format, use a DIB format and a dummy BITMAPINFO structure. Then use SetDIBitsToDevice to copy to the DC.
Be aware of the peculiarities of the DIB format – every line has to be extended 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.