Page 1 of 1
[14 Aug 2007] ReadPixel
Posted: Sat Jun 13, 2020 5:31 pm
by PEB
Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 14 Aug 2007 02:01:38 -0000
If I do this:
Code: Select all
SelectBrush(1)
NewColor$=ReadPixel(5,5)
EndSelect
DebugPrint(NewColor$)
I get this: 4290723647
How do I interpret this output? In other words, how do I find the RGB values for this color?
Thanks,
[14 Aug 2007] Re: ReadPixel
Posted: Sat Jun 13, 2020 5:31 pm
by airsoftsoftwair
Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 14 Aug 2007 11:56:28 +0200
How do I interpret this output? In other words, how do I find the RGB values for this color?
ReadPixel() returns an RGB value. What you have above is just decimal notation of the color which might be a little bit confusing because RGB colors are normally dealt with in hexadecimal notation. To get hexadecimal notation, just use:
Code: Select all
color = ReadPixel(5, 5)
DebugPrint(HexStr(color))
To get the single color components use:
Code: Select all
r = Red(color)
g = Green(color)
b = Blue(color)
[14 Aug 2007] Re: ReadPixel
Posted: Sat Jun 13, 2020 5:31 pm
by PEB
Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 14 Aug 2007 07:07:21 -0700 (PDT)
Thanks Andreas.
I'll give it a try.