I want to make a treasure-map, which I blit from an other OffScreen-surface and it should look old and not in 65000 colors.

Thanks for your help
Posted 13 August 1999 - 02:09 PM

Posted 13 August 1999 - 04:24 AM
first, you deconstruct the pixel into its R, G, and B
if in 565, divide the G component by two, so that everything is from 0 to 31
grayscaling is done simply by weighting the colors by percentages.
a good weight to use is:
Blue: 11%
Green: 59%
Red: 30%
so, now calculate:
NewRGB=(b*11+g*59+r*30)/100;
use this new value as the new red, green, and blue components (if in 565, multiply by 2 for green)
now reconstruct the pixel from these RGB values, and put the pixel
if you want a "yellowed paper" or "antique" look, multiply the blue by 7/8 or 3/4 (or whatever fraction you like, based on your preference)
you can also get a nice "smudge" or blurring effect by taking some areas and apply an anti-aliasing algorithm between every other pixel.
Posted 13 August 1999 - 07:48 AM
How can I read one Pixel from a Surface and get the color? Is there a funktion like Getpixel in Pascal?Posted 13 August 1999 - 02:09 PM
(if you want "direct" memory access to the surface)
Lock()
Unlock()
(or, if you want the slower GDI route)
GetDC()
ReleaseDC()