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.
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. |
If the coordinates are omitted for either method, the values of CurrentX and CurrentY are used. PSet sets the specified point to the current ForeColor. PSet interacts with DrawWidth—if DrawWidth is more than one, multiple pixels get colored. (In fact, at the resolutions we work at, we can't even see the colored pixel when DrawWidth is 1. Either that or no pixel gets colored when DrawWidth is 1.) The docs say the colored pixels are centered on the specified point. That's wrong in VFP 3—in that version, the colored pixels use the specified point as the upper-left corner.
These methods are not affected by ScaleMode—they always address individual pixels.
* 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
Box, CurrentX, CurrentY, DrawWidth, FillColor, FillStyle, ForeColor, ScaleMode