Sign in Join
FPDoc Onlineexperiment

TCanvas.Pixels property

Member of TCanvaspublicIn unit Graphics

The color of the Pixels located at the specified position.

Declaration

pascal
property Pixels[X: Integer;Y: Integer]: TColor read GetPixel write SetPixel;

Description

Pixels is an indexed TColor color property which provides access to the color for pixels on the drawing surface. The X and Y arguments provide the horizontal and vertical offsets on the drawing surface.

Read and write access to color values in the property requires a valid Handle (or device context) for the canvas. RequiredState is called, and allocates a Handle if one does not already exist. An EInvalidGraphicOperation exception may be raised in the method if a valid handle cannot be acquired.

Methods in the widgetset class are called to read or write the pixel color using the Handle.

When setting a new color for a pixel, the Changing method is called to signal the OnChanging event handler (when assigned). After setting the new color, the Changed method is called to signal the OnChange event handler (when assigned).

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.