Another Palette problem --- Not having one ...

Another Palette problem --- Not having one ...

Post by R.Wiese » Mon, 05 Apr 2004 03:38:54


Hello All,

I've copied a piece of code off the web
http://www.yqcomputer.com/ ) that takes snapshots
of a window (or whole desktop), which works quite nicely. :-)

One thing I would like to know : Is it possible to lessen the number of
colors used in the DIB ? In other words, can I instruct the DDB-to-DIB map
a 16 or 32-bit true-color to (a palette of) 256 or even as low as 16 colors
?

I would like to be able to take "snapshots" of certain things, but would
like to keep the size of the images to a minimum (will see if I can convert
it to GIF or something like it ...)

Regards,
Rudy Wieser
 
 
 

Another Palette problem --- Not having one ...

Post by Mike D Sut » Mon, 05 Apr 2004 05:07:52

> I've copied a piece of code off the web

Create a DIBSection at the desired depth and palette, select it into a DC and BitBlt() to it from your source true-colour version -
BitBlt() performs the bit-depth conversion for you. Have a look at the "GDI Halftone dithering example" example on my site for an
example of how to use halftone dithering rather than getting stuck with the default banding you'll get with the normal GDI bit-depth
conversion. This still isn't particularly great but as good as GDI goes unfortunately so for better quality you'll need to look
into a third party solution, take a look over on www.vbaccelerator.com for the optimal palette and dithering examples.
Hope this helps,

Mike


- Microsoft Visual Basic MVP -
E-Mail: XXXX@XXXXX.COM
WWW: http://www.yqcomputer.com/

 
 
 

Another Palette problem --- Not having one ...

Post by R.Wiese » Wed, 07 Apr 2004 01:17:28

Mike D Sutton < XXXX@XXXXX.COM > schreef in berichtnieuws
XXXX@XXXXX.COM ...

Hello Mike,

Thanks for your answer. It looks like those graphics-functions can do a
lot I do not (yet) know :-)

Regards,
Rudy Wieser

snapshots
map
colors
convert
and BitBlt() to it from your source true-colour version -
"GDI Halftone dithering example" example on my site for an
the default banding you'll get with the normal GDI bit-depth
unfortunately so for better quality you'll need to look
the optimal palette and dithering examples.