i'm using this:
GetClipboardData(CF_DIB);
i view it as a BITMAPINFOHEADER and take into account
most of the time when i copy an image i can get the pixel data from it just fine. but when copying from certain applications like Telegram, sometimes the colors are messed up, sometimes the image is skewed, all sorts of crazy artifacts happen when trying to view the clipboard image. i don't see anything special in the BITMAPINFOHEADER of these images i'm rendering incorrectly. what could i possibly be forgetting to handle?
A little-known fact about Microsoft bitmaps is that every row is padded to an even multiple of 4 bytes. It is natural to assume that one row follows the next immediately, but there may be 1 to 3 bytes of padding on each row that will throw your alignment off. You will see this as colors that aren't what they should be, or a skewed image as each row is shifted from its proper position.
If your pixels are all 4 bytes (RGBA) or your image width is a multiple of 4 (more common than random chance would suggest) each row will already be a multiple of 4 bytes, and you won't notice a problem.