Pixel(X: Integer, Y: Integer): IGxColor;
X. X coordinate.
Y. Y coordinate.
The Pixel property determines a color of a separate pixel with the specified coordinates.
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(6, 6, 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: