Point, RGBPoint and PTst Functions

Purpose

Returns the color of a point.

Syntax

rgb% = Point(x,y)

rgb% = PTst(x,y)

rgb% = RGBPoint(x,y)

x, y :floating point expression

Description

PTst(x, y), RGBPoint(x, y) and Point(x, y) are identical and all return the color of a point with the coordinates x, y, except the computer works from a palette (unlikely these days) where Point returns the palette number rather the colour itself.

Example

OpenW # 1

Local col%

Do

If MouseK = 1

Color Rand(_C) - 1

Plot 100, 100

Print AT(1, 1); Hex(Point(100, 100), 6); Space(2)//prints the color code of a set point

col% = RGBPoint(100, 100) // or PTst(100,100) if you prefer

Color 0

Print AT(1, 2); "Red: "; Hex(GetRValue(col%), 2); " "

Print AT(1, 3); "Green: "; Hex(GetGValue(col%), 2); " "

Print AT(1, 4); "Blue: "; Hex(GetBValue(col%), 2); " "

While MouseK = 1 : Wend

EndIf

DoEvents

Until MouseK = 2 Or Win_1 Is Nothing

CloseW # 1

Remarks

See Also

-

{Created by Sjouke Hamstra; Last updated: 21/10/2014 by James Gaite}