Reputation: 1971
I have an application in which the user usually loads 24-bit bitmaps. I need to save the images in a 16-bit rgb565 format. How can I do that in C#?
Upvotes: 2
Views: 5231
Reputation: 17527
The thread on go4answers does not include authors details on each answer and it is identical to an MSDN forum thread so I suspect that it is a blatant copy of this MSDN thread: 24 bit bmp to rGB565 file conversion. The MSDN thread also has more answers and more discussion, so I'd use it in preference to the go4answers one Liviu M recommends in his answer. I have no idea why Google prefers the go4answers copy over the MSDN original, hopefully that'll change.
Just to summarise a few of the points covered in the MSDN thread.
Format16bppRgb565
The discussion of the red/blue swap is fairly lengthy (useful bug, by design, problem, not a problem, ...) and seems to reach the conclusion that PixelFormats.Bgr565 is in fact in RGB565.
Upvotes: 3