Image Class
Represents an image that consists of the pixels data and its attributes.
- Inheritance:
- System.
Object Image
Implements
Constructors
Image(Image, Image[])
Initializes a new instance of the Image class with a specified collection of image frames.
Parameters
image
- Image
The first image that contain frames to be included in the image.
images
- Image[]
A list containing the images that contain frames to be included in the image.
Image(ImageFrame, ImageFrame[])
Initializes a new instance of the Image class with a specified collection of image frames.
Parameters
frame
- Image
Frame
The first frame to be included in the image.
frames
- Image
Frame []
A list containing the frames to be included in the image.
Image(IEnumerable<Image>, Boolean)
Initializes a new instance of the Image class with a specified collection of image frames.
Parameters
images
- System.
Collections. <Image>Generic. IEnumerable
A list containing the images that contain frames to be included in the image.
disposeImagesAfterLoading
- System.
Boolean
Disposes the given images after loading of frames are completed. In doing so this prevents loading all images till the end and handles memory more efficiently.
Image(IEnumerable<ImageFrame>)
Initializes a new instance of the Image class with a specified collection of image frames.
Parameters
frames
- System.
Collections. <ImageGeneric. IEnumerable Frame >
A list containing the frames to be included in the image.
Properties
DpiX
Gets the horizontal dots per inch (dpi) of the image or System.
Property Value
- System.
Double
The horizontal dots per inch (dpi) of the image; that is, the dots per inch (dpi) along the x-axis.
DpiY
Gets the vertical dots per inch (dpi) of the image or System.
Property Value
- System.
Double
The vertical dots per inch (dpi) of the image; that is, the dots per inch (dpi) along the y-axis.
Frames
Gets the image frames contained in the image.
Property Value
The image frames contained in the image.
Height
Gets the height of the image in pixels.
Property Value
- System.
Int32
The height of the image in pixels.
Metadata
Gets the metadata associated with the image.
Property Value
The metadata associated with the image.
Width
Gets the width of the image in pixels.
Property Value
- System.
Int32
The width of the image in pixels.
Methods
ApplyFilter(Action<FilterBuilder>)
Applies a filter.
Parameters
configureFilter
- System.
Action <FilterBuilder >
A delegate to configure the filter.
Crop(Int32, Int32, Int32, Int32)
Crops the image to the given position and size.
Parameters
x
- System.
Int32
The horizontal position of cropping.
y
- System.
Int32
The vertical position of cropping.
width
- System.
Int32
Width of the crop area.
height
- System.
Int32
Height of the crop area.
Dispose()
Releases all resources used by the image.
Load(Stream)
Loads an image from the specified stream.
Parameters
stream
- System.
IO. Stream
The stream from which to load an image.
Returns
A loaded image.
Exceptions
- System.
Argument Null Exception
stream
is null.
Load(String)
Loads an image from a file with the specified path.
Parameters
path
- System.
String
The file path from which to load an image.
Returns
A loaded image.
Exceptions
- System.
Argument Null Exception
path
is null.
Resize(Nullable<Int32>, Nullable<Int32>)
Resizes the image to the given size.
Parameters
width
- System.
Nullable <System.Int32 >
Target width of the resulting image. If null then this will be calculated by aspect ratio.
height
- System.
Nullable <System.Int32 >
Target height of the resulting image. If null then this will be calculated by aspect ratio.
Exceptions
- System.
Argument Null Exception
Thrown when width
and height
are both null.
RotateFlip(RotateFlipType)
Rotates and flips the image by the given enum.
Parameters
rotateFlipType
- Rotate
Flip Type
The rotate flip type to perform rotation and flipping.
Save(Stream, ImageFileFormat)
Saves the image to the specified stream with the given file format.
Parameters
stream
- System.
IO. Stream
The stream in which to save the image.
fileFormat
- Image
File Format
The file format in which to save the image.
Exceptions
- System.
Argument Null Exception
stream
is null.
Save(Stream, SaveOptions)
Saves the image to the specified stream.
Parameters
stream
- System.
IO. Stream
The stream in which to save the image.
options
- Save
Options
The saving options which can be used to define settings for save operation.
Exceptions
- System.
Argument Null Exception
stream
or options
is null.
Save(String)
Saves the image to the specified file path.
Parameters
path
- System.
String
The file path to which to save the image.
Exceptions
- System.
Argument Null Exception
path
is null.
Save(String, ImageFileFormat)
Saves the image to the specified file path.
Parameters
path
- System.
String
The file path in which to save the image.
fileFormat
- Image
File Format
The file format in which to save the image.
Exceptions
- System.
Argument Null Exception
path
is null.
Save(String, SaveOptions)
Saves the image to the specified file path.
Parameters
path
- System.
String
The file path in which to save the image.
options
- Save
Options
The saving options which can be used to define settings for save operation.
Exceptions
- System.
Argument Null Exception
path
is null.