Class TiffFrame
- Namespace
- Aspose.Imaging.FileFormats.Tiff
- Assembly
- Aspose.Imaging.dll
The tiff frame.
public sealed class TiffFrame : RasterCachedImage, IDisposable, IObjectWithBounds, IRasterImageArgb32PixelLoader, IRasterImageRawDataLoader, IHasExifData, IHasXmpData, IHasMetadata
- Inheritance
-
TiffFrame
- Implements
- Inherited Members
Constructors
TiffFrame(TiffOptions, int, int)
Initializes a new instance of the TiffFrame class.
public TiffFrame(TiffOptions options, int width, int height)
Parameters
options
TiffOptionsThe frame options.
width
intThe width.
height
intThe height.
Exceptions
- ArgumentNullException
Options parameter is null.
TiffFrame(RasterImage)
Initializes a new instance of the TiffFrame class.
public TiffFrame(RasterImage image)
Parameters
image
RasterImageThe image to initialize frame pixel and palette data with.
TiffFrame(RasterImage, TiffOptions)
Initializes a new instance of the TiffFrame class.
public TiffFrame(RasterImage image, TiffOptions options)
Parameters
image
RasterImageThe image to initialize frame pixel and palette data with.
options
TiffOptionsThe options to use for the newly created frame.
TiffFrame(Stream)
Initializes a new instance of the TiffFrame class.
public TiffFrame(Stream stream)
Parameters
stream
StreamThe stream to load an image from and initialize frame pixel and palette data with.
TiffFrame(Stream, TiffOptions)
Initializes a new instance of the TiffFrame class.
public TiffFrame(Stream stream, TiffOptions options)
Parameters
stream
StreamThe stream to load an image from and initialize frame pixel and palette data with.
options
TiffOptionsThe options to use for the newly created frame.
TiffFrame(string)
Initializes a new instance of the TiffFrame class.
public TiffFrame(string path)
Parameters
path
stringThe path to load an image from and initialize frame pixel and palette data with.
TiffFrame(string, TiffOptions)
Initializes a new instance of the TiffFrame class.
public TiffFrame(string path, TiffOptions options)
Parameters
path
stringThe path to load an image from and initialize frame pixel and palette data with.
options
TiffOptionsThe options to use for the newly created frame.
Properties
BackgroundColor
Gets or sets a value for the background color.
public override Color BackgroundColor { get; set; }
Property Value
BitsPerPixel
Gets the image bits per pixel count.
public override int BitsPerPixel { get; }
Property Value
- int
The image bits per pixel count.
ExifData
Gets or sets EXIF data from frame.
public ExifData ExifData { get; set; }
Property Value
- ExifData
EXIF data container
FrameOptions
Gets the frame create options.
public TiffOptions FrameOptions { get; }
Property Value
HasAlpha
Gets a value indicating whether this instance has alpha.
public override bool HasAlpha { get; }
Property Value
- bool
true
if this instance has alpha; otherwise,false
.
HasTransparentColor
Gets a value indicating whether image has transparent color.
public override bool HasTransparentColor { get; set; }
Property Value
Height
Gets the image height.
public override int Height { get; }
Property Value
- int
The image height.
HorizontalResolution
Gets or sets the horizontal resolution, in pixels per inch, of this RasterImage.
public override double HorizontalResolution { get; set; }
Property Value
- double
The horizontal resolution.
PathResources
Gets or sets the path resources.
public List<PathResource> PathResources { get; set; }
Property Value
- List<PathResource>
The path resources.
VerticalResolution
Gets or sets the vertical resolution, in pixels per inch, of this RasterImage.
public override double VerticalResolution { get; set; }
Property Value
- double
The vertical resolution.
Width
Gets the image width.
public override int Width { get; }
Property Value
- int
The image width.
XmpData
Gets or sets Xmp data.
public override XmpPacketWrapper XmpData { get; set; }
Property Value
Methods
AlignResolutions()
Helper method to make horizontal and vertical resolutions equal.
public void AlignResolutions()
CopyFrame(TiffFrame)
Copies the entire frame (duplicates).
public static TiffFrame CopyFrame(TiffFrame tiffFrame)
Parameters
tiffFrame
TiffFrameThe tiff frame to copy.
Returns
- TiffFrame
The newly copied tiff frame.
CreateFrameFrom(TiffFrame, TiffOptions)
Creates the frame from specified tiffFrame
using the specified options
.
The pixel data is preserved but converted to the desired format.
public static TiffFrame CreateFrameFrom(TiffFrame tiffFrame, TiffOptions options)
Parameters
tiffFrame
TiffFrameThe tiff frame to create from.
options
TiffOptionsThe new options to use.
Returns
- TiffFrame
The newly created frame.
Crop(Rectangle)
Cropping the image.
public override void Crop(Rectangle rectangle)
Parameters
rectangle
RectangleThe rectangle.
GetOriginalOptions()
Gets the options based on the original file settings. This can be helpful to keep bit-depth and other parameters of the original image unchanged. For example, if we load a black-white PNG image with 1 bit per pixel and then save it using the Save(string) method, the output PNG image with 8-bit per pixel will be produced. To avoid it and save PNG image with 1-bit per pixel, use this method to get corresponding saving options and pass them to the Save(string, ImageOptionsBase) method as the second parameter.
public override ImageOptionsBase GetOriginalOptions()
Returns
- ImageOptionsBase
The options based on the original file settings.
ReleaseManagedResources()
Releases the managed resources. Make sure no unmanaged resources are released here, since they may have been already released.
protected override void ReleaseManagedResources()
RemoveMetadata()
public override void RemoveMetadata()
Resize(int, int, ResizeType)
Resizes the image.
public override void Resize(int newWidth, int newHeight, ResizeType resizeType)
Parameters
newWidth
intThe new width.
newHeight
intThe new height.
resizeType
ResizeTypeThe resize type.
Rotate(float, bool, Color)
Rotate image around the center.
public override void Rotate(float angle, bool resizeProportionally, Color backgroundColor)
Parameters
angle
floatThe rotate angle in degrees. Positive values will rotate clockwise.
resizeProportionally
boolif set to
true
you will have your image size changed according to rotated rectangle (corner points) projections in other case that leaves dimensions untouched and only internal image contents are rotated.backgroundColor
ColorColor of the background.
SaveData(Stream)
protected override void SaveData(Stream stream)
Parameters
stream
Stream
UpdateDimensions(int, int)
protected override void UpdateDimensions(int newWidth, int newHeight)