Home > Language Reference > Classes > Display

PutPixel Method

Sets the color of a pixel.

Syntax

Public Sub PutPixel(ByVal x As Integer, ByVal y As Integer, Optional ByVal lColor As Long = -1)

ParameterDescription
xX-coordinate of the pixel.
yY-coordinate of the pixel.
lColorColor of the pixel.

Remarks

The PutPixel method sets the color of a pixel located at the coordinates (x,y) to that specified by the optional parameter lColor. If this is omitted, the pixel color will be set to the current foreground color.

This method enqueues the drawing request in the graphics instruction buffer. The pixel color is only set when the buffer is emptied, either because it is full or because the Flush method is called.

Note: specifying a value for the lColor parameter makes the call slower. Thus, if you need to fill several pixels with the same color, it is advised to set the foreground color to that color using the ForeColor property, and to omit the lColor parameter on the subsequent PuPixel calls.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0N/A