IGxBitmap.Pixel

Syntax

Pixel(X: Integer, Y: Integer): IGxColor;

Parameters

X. X coordinate.

Y. Y coordinate.

Description

The Pixel property determines a color of a separate pixel with the specified coordinates.

Example

Executing the example requires a form with the Button1 button and the ImageBox component named ImageBox1.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Img: IGxBitmap;
Begin
    Img := GxBitmap.CreateNew(
66, GxPixelFormat.Format32bppArgb);
    Img.Pixel(
0,0):= GxColor.FromKnownColor(GxKnownColor.Red);
    Img.Pixel(
0,5):= GxColor.FromKnownColor(GxKnownColor.Blue);
    Img.Pixel(
5,0):= GxColor.FromKnownColor(GxKnownColor.Yellow);
    Img.Pixel(
5,5):= GxColor.FromKnownColor(GxKnownColor.Green);
    Img.SetResolution(
6,6);
    ImageBox1.Image := Img;
    ImageBox1.Stretch :=
True;
End Sub Button1OnClick;

Clicking the button creates a raster image of the 6*6 size. For image angular points, the color will be changed. After that, the image will be loaded to the ImageBox component.

See also:

IGxBitmap