|
Prev: Customdraw CListCtrl with WM_MEASUREITEM <d44c3b6d-f806-4d01-944a-238a07ecef06@a5g2000prg.googlegroups.com>
Next: Image file Class handle
From: Peter Olcott on 22 May 2008 09:36 Do indexed colors of a color palette save any conventional RAM? I just read a text book that said the only purpose of color palettes of indexed colors was for video cards that did not support 24-bit or 32-bit color. Because of this I am estimating that even graphics files that are stored as 8-bit pixels (such as GIF) are loaded into the memory device context as either 24-bits or 32-bits. Is this correct?
From: dertopper on 22 May 2008 11:06 On 22 Mai, 15:36, "Peter Olcott" <NoS...(a)SeeScreen.com> wrote: > Do indexed colors of a color palette save any conventional > RAM? Yes. Image your VGA card doesn't have enough memory to hold a complete picture with 24 bpp, but the VGA controller can generate video signals that correspond to 8bits per color channel. This means that you define a palette of the colors you actually want to display (you rarely want to display the whole 16 million color at once) so that the picture uses less memory. > I just read a text book that said the only purpose of color > palettes of indexed colors was for video cards that did not > support 24-bit or 32-bit color. I'd rather say that those video cards don't have enough video memory to hold 24bpp images. > Because of this I am > estimating that even graphics files that are stored as 8-bit > pixels (such as GIF) are loaded into the memory device > context as either 24-bits or 32-bits. Is this correct? That's up to the internal implementation of GDI. I guess that a memory device context will not expand an 8 bpp image to 24bpp without any good reasons (I can only guess that there may be graphic cards that only support 24bpp, so GDI would have to transform the 8bpp indexed image to 24bpp when you BitBlt the image to the screen). Regards, Stuart
From: Joseph M. Newcomer on 22 May 2008 12:10
On Thu, 22 May 2008 08:36:42 -0500, "Peter Olcott" <NoSpam(a)SeeScreen.com> wrote: >Do indexed colors of a color palette save any conventional >RAM? **** Did I not already answer this? OF COURSE they save conventional memory, because you don't need 32 bits or 24 bits to represent what can be represented in 8 bits! **** >I just read a text book that said the only purpose of color >palettes of indexed colors was for video cards that did not >support 24-bit or 32-bit color. **** That was certainly true in the past. But it is not the only reason. ***** >Because of this I am >estimating that even graphics files that are stored as 8-bit >pixels (such as GIF) are loaded into the memory device >context as either 24-bits or 32-bits. Is this correct? **** The DC is a representative of what is on the card; there is no reason to assume that the 24-bit color is stored anywhere but on the video card joe **** > Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm |