Re:Getting RGB Values from a TColor ?
Quote
> > How can I get the individual RGB values from a tcolor? If I had a tcolor
> > var that had its color set previously to 127,122,133 how could I know this
> > and get these values from the current color? Is there a standard function I
> > cannot find for doing this?
> First, use the ColorToRGB function. Then use GetRValue, GetGValue and
> GetBValue to get the RGB components.
Whoa, thats absolutely cool ! When I tried to isolate Red, Green and Blue values
out of a TColor (in $0000BBGGRR), then at first:
I copied the Hexnumber to a string and copied the needed pair of numbers out of
it and transformed the number back to a hex. But after a time, this seemed even
to me not only slow (consider pixel amount of DIN 4 Bitmap) but also a cheap
trick. So second:
I shifted the unneeded hexnumbers (shl and shr) out and then filled it with
zeroes by shifting it back. Took some time for me to get this idea. Went faster
now.
Now I will try GetXValue as soon as I can.