Class ImageInfo
- Namespace
- SixLabors.ImageSharp
- Assembly
- SixLabors.ImageSharp.dll
Contains information about the image including dimensions, pixel type information and additional metadata
public class ImageInfo
- Inheritance
-
ImageInfo
- Inherited Members
Constructors
ImageInfo(Size, ImageMetadata)
Initializes a new instance of the ImageInfo class.
public ImageInfo(Size size, ImageMetadata metadata)
Parameters
sizeSizeThe size of the image in px units.
metadataImageMetadataThe image metadata.
ImageInfo(Size, ImageMetadata, IReadOnlyList<ImageFrameMetadata>?)
Initializes a new instance of the ImageInfo class.
public ImageInfo(Size size, ImageMetadata metadata, IReadOnlyList<ImageFrameMetadata>? frameMetadataCollection)
Parameters
sizeSizeThe size of the image in px units.
metadataImageMetadataThe image metadata.
frameMetadataCollectionIReadOnlyList<ImageFrameMetadata>The collection of image frame metadata.
Properties
Bounds
Gets the bounds of the image.
public Rectangle Bounds { get; }
Property Value
FrameCount
Gets the number of frame metadata entries available for the image.
public int FrameCount { get; }
Property Value
Remarks
This value is the same as FrameMetadataCollection count and may be 0 when frame
metadata was not populated by the decoder.
FrameMetadataCollection
Gets the metadata associated with the decoded image frames, if available.
public IReadOnlyList<ImageFrameMetadata> FrameMetadataCollection { get; }
Property Value
Remarks
For multi-frame formats, decoders populate one entry per decoded frame. For single-frame formats, this collection is typically empty.
Height
Gets the image height in px units.
public int Height { get; }
Property Value
Metadata
Gets any metadata associated with the image.
public ImageMetadata Metadata { get; }
Property Value
PixelType
Gets information about the image pixels.
public PixelTypeInfo PixelType { get; }
Property Value
Size
Gets the size of the image in px units.
public Size Size { get; }
Property Value
Width
Gets the image width in px units.
public int Width { get; }
Property Value
Methods
GetPixelMemorySize()
Gets the total number of bytes required to store the image pixels in memory.
public long GetPixelMemorySize()
Returns
- long
The total number of bytes required to store the image pixels in memory.
Remarks
This reports the in-memory size of the pixel data represented by this ImageInfo, not the encoded size of the image file. The value is computed from the image dimensions and PixelType. When FrameMetadataCollection contains decoded frame metadata, the per-frame size is multiplied by that count. Otherwise, the value is the in-memory size of the single image frame represented by this ImageInfo.