PSet, Point
These two form methods give you fine control over colors. PSet lets you color an individual pixel. Point tells you the color of a specified pixel.
Usage |
frmForm.PSet( [ nXCoord, nYCoord ] ) nColor = frmForm.Point( [ nXCoord, nYCoord ] ) |
Parameter |
Value |
Meaning |
nXCoord, nYCoord |
Numeric |
The coordinates of the point of interest. |
nColor |
-1 |
The specified point is not in the form. |
0 - 16,777,215 |
The color of the specified point. |
In VFP 5 and later, when DrawWidth is greater than 2, the point you specify doesn't actually get colored. Instead, as we said, you get a box centered on the specified point. The confusing thing is that applying Point to that point immediately after "painting" it with PSet gives you not the foreground color, but the background color. See the examples to see how this works. In fact, FillStyle and FillColor determine what color that point actually is. It's as if you called the Box method. |
Example |
* Color a few points _SCREEN.ForeColor = RGB(255, 0, 0) _SCREEN.PSet(100, 100) && It's red, but hard to see ? _SCREEN.Point() && Returns 255 _SCREEN.Cls _SCREEN.DrawWidth = 10 _SCREEN.PSet() && Now you can see it ? _SCREEN.Point() && Returns the value of BackColor ? _SCREEN.Point(100, 100) && So does this ? _SCREEN.Point(95, 95) && This, however, gives you 255 ? _SCREEN.Point(95, 104) && So does this and a number of others ? _SCREEN.Point(-10, -200) && Returns -1 |
See Also |
Box, CurrentX, CurrentY, DrawWidth, FillColor, FillStyle, ForeColor, ScaleMode |