Skip to main content
gamedev.net
🔒 Locked

Bit depth conversion problem

Started by Sorairo 0 replies 450+ views
Original Post
Sorairo
Sorairo
I''m writing a win32 GDI application using DIBs to draw 24-bit BMPs. The problem is, once the DIB is blit to the window, the quality is degraded compared to the original BMP loaded in Paint, Photoshop, or IE. Granted I''m going from 24-bit to 16-bit, but why does the conversion look worse in my program than any other image viewer? Here''s the relevant technical info: - Desktop is set to 16-bit. - BMP is saved in 24-bit uncompressed and loaded using LoadImage(). It''s then blit to a 16-bit DIB created using CreateDIBSection(). - The backbuffer is a 16-bit DIB. - I use CreateCompatibleDC(display''s HDC - obviously 16-bit) in each case. - When drawing, I use BitBlt() to blit from BMP''s DIB to backbuffer''s DIB. I then BitBlt() to the display HDC. The only solution I''ve found so far is creating 32-bit DIBs, in which case the BMP will look as it does in other viewers, still with the 16-bit desktop. All I can think of is that all of the viewers I tried use 32-bit memory surfaces regardless of the display''s bit depth, but I want 16-bit for performance reasons. I''m lost. Thanks for any help, if you even manage to understand this post PS: No, I''m not planning to use DirectX - that would be cheating.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.