RasterImageSetPixel Method |
Sets an image pixel for the specified position.
Namespace: Aspose.ImagingAssembly: Aspose.Imaging (in Aspose.Imaging.dll) Version: 22.05
Syntaxpublic void SetPixel(
int x,
int y,
Color color
)
Public Sub SetPixel (
x As Integer,
y As Integer,
color As Color
)
public:
void SetPixel(
int x,
int y,
Color color
)
member SetPixel :
x : int *
y : int *
color : Color -> unit
Parameters
- x
- Type: SystemInt32
The pixel x location. - y
- Type: SystemInt32
The pixel y location. - color
- Type: Aspose.ImagingColor
The pixel color for the specified position.
ExamplesThe following example loads a raster image, and sets the color of an arbitrary pixel.
[C#]
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(@"c:\temp\sample.png"))
{
Aspose.Imaging.RasterImage rasterImage = (Aspose.Imaging.RasterImage)image;
rasterImage.SetArgb32Pixel(0, 0, Aspose.Imaging.Color.Aqua.ToArgb());
rasterImage.SetPixel(0, 0, Aspose.Imaging.Color.Aqua);
}
See Also