PngImage.RawDataFormat property

Gets the raw data format.

public override PixelDataFormat RawDataFormat { get; }


The following example loads PNG images and prints information about raw data format and alpha channel.


// The PNG images to load.
string[] fileNames = new string[]

foreach (string fileName in fileNames)
    using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(fileName))
        Aspose.Imaging.FileFormats.Png.PngImage pngImage = (Aspose.Imaging.FileFormats.Png.PngImage)image;
        System.Console.WriteLine("ImageFile={0}, FileFormat={1}, HasAlpha={2}", fileName, pngImage.RawDataFormat, pngImage.HasAlpha);

// The output may look like this:
// ImageFile=c:\temp\sample.png, FileFormat=Rgb24Bpp, used channels: 8,8,8, HasAlpha=False
// ImageFile=c:\temp\alpha.png, FileFormat=RGBA32Bpp, used channels: 8,8,8,8, HasAlpha=True

See Also