RasterImageSaveArgb32Pixels Method
Saves the 32-bit ARGB pixels.

Namespace: Aspose.Imaging
Assembly: Aspose.Imaging (in Aspose.Imaging.dll) Version: 20.05
Syntax
public void SaveArgb32Pixels(
	Rectangle rectangle,
	int[] pixels
)

Parameters

rectangle
Type: Aspose.ImagingRectangle
The rectangle to save pixels to.
pixels
Type: SystemInt32
The 32-bit ARGB pixels array.
Examples
The following example fills the central area of a raster image with black pixels using the Aspose.Imaging.RasterImage.SaveArgb32Pixels method.
[C#]

string dir = "c:\\temp\\";

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.png"))
{
    Aspose.Imaging.RasterImage rasterImage = (Aspose.Imaging.RasterImage)image;

    // The black square
    int[] pixels = new int[(rasterImage.Width / 2) * (rasterImage.Height / 2)];
    for (int i = 0; i < pixels.Length; i++)
    {
        pixels[i] = Color.Black.ToArgb();
    }

    // Draw the black square at the center of the image.
    Aspose.Imaging.Rectangle area = new Aspose.Imaging.Rectangle(rasterImage.Width / 4, rasterImage.Height / 4, rasterImage.Width / 2, rasterImage.Height / 2);
    rasterImage.SaveArgb32Pixels(area, pixels);

    rasterImage.Save(dir + "sample.SaveArgb32Pixels.png");
}
See Also