[]
        
(Showing Draft Content)

GrapeCity.Documents.Drawing.Image

Image Class

A lightweight class representing an image in a file, stream, or array of bytes.

By default, this class does not load or decode the actual pixel data unless InMemoryData is passed to FromFile(string, ImageBinding, int), ToImage(ImageBinding) or ToImage(ImageBinding).

Use the ToGcBitmap() method to load the image into a GcBitmap in order to access and manipulate the image data.

Inheritance
Image
Implements
Namespace: GrapeCity.Documents.Drawing
Assembly: DS.Documents.Imaging.dll
Syntax
public class Image : IImage, IDisposable
Public Class Image
    Implements IImage, IDisposable

Properties

Name Description
Binding

Gets the value indicating how the image data is attached to the Image object.

Encoding

Gets the encoding of the image.

ExifProfile

Gets an instance of ExifProfile with Exif metadata of the image.

FilePath

Gets the full path to the image file, if Binding is equal to FilePath.

FrameIndex

Gets the index of the image frame.

Height

Gets the height of the image in pixels.

HorizontalResolution

Gets the horizontal resolution (dots per inch) of the image.

InMemoryData

Gets the byte array with image data, if Binding is equal to InMemoryData.

Initialized

Gets a value indicating if the image is initialized and not disposed yet.

IsDisposed

Gets a value indicating whether the Image has been disposed of.

OwnStream

Gets a value indicating if the input stream should be closed when the Image is disposed.

Rotation

Gets the flip and rotate transformations that must be applied to the image.

Stream

Gets the image stream, if Binding is equal to Stream.

StreamStartPosition

Gets the start position for image data in the associated Stream.

VerticalResolution

Gets the vertical resolution (dots per inch) of the image.

Width

Gets the width of the image in pixels.

Methods

Name Description
Dispose()

Disposes the current instance.

Dispose(bool)

Disposes the current instance.

FromBytes(byte[], int)

Creates an Image from a byte array. JPEG, PNG, WEBP, GIF, BMP and TIFF formats are supported.

FromFile(string, ImageBinding, int)

Creates an Image from a file. JPEG, PNG, WEBP, GIF, BMP and TIFF formats are supported.

FromStream(Stream, bool, int)

Creates an Image from a stream. JPEG, PNG, WEBP, GIF, BMP and TIFF formats are supported.

ToGcBitmap()

Creates an instance of the GcBitmap class from the current Image.

ToGcBitmap(GcBitmap)

Loads the image into an existing instance of GcBitmap.

ToGcBitmap(bool)

Creates an instance of the GcBitmap class from the current Image.

ToStream()

Saves the source image (all frames) to a MemoryStream.