Table of Contents

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 TiffOptions

The frame options.

width int

The width.

height int

The height.

Exceptions

ArgumentNullException

Options parameter is null.

TiffFrame(RasterImage)

Initializes a new instance of the TiffFrame class.

public TiffFrame(RasterImage image)

Parameters

image RasterImage

The 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 RasterImage

The image to initialize frame pixel and palette data with.

options TiffOptions

The options to use for the newly created frame.

TiffFrame(Stream)

Initializes a new instance of the TiffFrame class.

public TiffFrame(Stream stream)

Parameters

stream Stream

The 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 Stream

The stream to load an image from and initialize frame pixel and palette data with.

options TiffOptions

The options to use for the newly created frame.

TiffFrame(string)

Initializes a new instance of the TiffFrame class.

public TiffFrame(string path)

Parameters

path string

The 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 string

The path to load an image from and initialize frame pixel and palette data with.

options TiffOptions

The 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

Color

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

TiffOptions

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

bool

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

XmpPacketWrapper

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 TiffFrame

The 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 TiffFrame

The tiff frame to create from.

options TiffOptions

The new options to use.

Returns

TiffFrame

The newly created frame.

Crop(Rectangle)

Cropping the image.

public override void Crop(Rectangle rectangle)

Parameters

rectangle Rectangle

The 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()

Removes this image instance metadata by setting this XmpData and ExifData values to null.

public override void RemoveMetadata()

Resize(int, int, ResizeType)

Resizes the image.

public override void Resize(int newWidth, int newHeight, ResizeType resizeType)

Parameters

newWidth int

The new width.

newHeight int

The new height.

resizeType ResizeType

The resize type.

Rotate(float, bool, Color)

Rotate image around the center.

public override void Rotate(float angle, bool resizeProportionally, Color backgroundColor)

Parameters

angle float

The rotate angle in degrees. Positive values will rotate clockwise.

resizeProportionally bool

if 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 Color

Color 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)

Parameters

newWidth int
newHeight int