[14 Aug 2007] ReadPixel

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
PEB
Posts: 591
Joined: Sun Feb 21, 2010 1:28 am

[14 Aug 2007] ReadPixel

Post 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,
User avatar
airsoftsoftwair
Posts: 5915
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[14 Aug 2007] Re: ReadPixel

Post 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)
PEB
Posts: 591
Joined: Sun Feb 21, 2010 1:28 am

[14 Aug 2007] Re: ReadPixel

Post 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.
Locked