TiffOptions Class
The tiff file format options. Note that width and height tags will get overwritten on image creation by width and height parameters so there is no need to specify them directly. Note that many options return a default value but that does not mean that this option is set explicitly as a tag value. To verify the tag is present use Tags property or the corresponding IsTagPresent method.
Inheritance Hierarchy
SystemObject
  Aspose.ImagingDisposableObject
    Aspose.ImagingImageOptionsBase
      Aspose.Imaging.ImageOptionsTiffOptions

Namespace: Aspose.Imaging.ImageOptions
Assembly: Aspose.Imaging (in Aspose.Imaging.dll) Version: 20.10
Syntax
public class TiffOptions : ImageOptionsBase

The TiffOptions type exposes the following members.

Constructors
  NameDescription
Public methodTiffOptions(TiffDataType)
Initializes a new instance of the TiffOptions class.
Public methodCode exampleTiffOptions(TiffExpectedFormat)
Initializes a new instance of the TiffOptions class. By default little endian convention is used.
Public methodTiffOptions(TiffOptions)
Initializes a new instance of the TiffOptions class.
Public methodTiffOptions(TiffExpectedFormat, TiffByteOrder)
Initializes a new instance of the TiffOptions class.
Properties
  NameDescription
Public propertyAlphaStorage
Gets or sets the alpha storage option. Options other than Unspecified are used when there are more than 3 SamplesPerPixel defined.
Public propertyArtist
Gets or sets the artist.
Public propertyBitsPerPixel
Gets the bits per pixel.
Public propertyCode exampleBitsPerSample
Gets or sets the bits per sample.
Public propertyCode exampleBufferSizeHint
Gets or sets the buffer size hint which is defined max allowed size for all internal buffers.
(Inherited from ImageOptionsBase.)
Public propertyCode exampleByteOrder
Gets or sets a value indicating the tiff byte order.
Public propertyColorMap
Gets or sets the color map.
Public propertyCode exampleCompressedQuality
Gets or sets compressed image quality. Used with the Jpeg compression.
Public propertyCode exampleCompression
Gets or sets the compression.
Public propertyCopyright
Gets or sets the copyright.
Public propertyDateTime
Gets or sets the date and time.
Public propertyDefaultMemoryAllocationLimit Obsolete.
Gets or sets the default memory allocation limit.
Public propertyDisposed
Gets a value indicating whether this instance is disposed.
(Inherited from DisposableObject.)
Public propertyDocumentName
Gets or sets the name of the document.
Public propertyExifIfd
Gets or sets the pointer to EXIF IFD.
Public propertyFaxT4Options
Gets or sets the fax t4 options.
Public propertyFileStandard
Gets or sets the TIFF file standard.
Public propertyFillOrder
Gets or sets the byte bits fill order.
Public propertyFullFrame
Gets or sets a value indicating whether [full frame].
(Inherited from ImageOptionsBase.)
Public propertyHalfToneHints
Gets or sets the halftone hints.
Public propertyIccProfile
Gets or sets the Icc profile stream.
Public propertyImageDescription
Gets or sets the image description.
Public propertyImageLength
Gets or sets the image length.
Public propertyImageWidth
Gets or sets the image width.
Public propertyInkNames
Gets or sets the ink names.
Public propertyIsExtraSamplesPresent
Gets a value indicating whether the extra samples is present.
Public propertyIsTiled
Gets a value indicating whether image is tiled.
Public propertyIsValid
Gets a value indicating whether the TiffOptions have been properly configured. Use Validate method as to find the failure reason.
Public propertyMaxSampleValue
Gets or sets the max sample value.
Public propertyMinSampleValue
Gets or sets the min sample value.
Public propertyMultiPageOptions
The multipage options
(Inherited from ImageOptionsBase.)
Public propertyOrientation
Gets or sets the orientation.
Public propertyPageName
Gets or sets the page name.
Public propertyPageNumber
Gets or sets the page number tag.
Public propertyPalette
Gets or sets the color palette.
(Overrides ImageOptionsBasePalette.)
Public propertyCode examplePhotometric
Gets or sets the photometric.
Public propertyCode examplePlanarConfiguration
Gets or sets the planar configuration.
Public propertyCode examplePredictor
Gets or sets the predictor for LZW compression.
Public propertyPremultiplyComponents
Gets or sets a value indicating whether components must be premultiplied.
Public propertyCode exampleProgressEventHandler
Gets or sets the progress event handler.
(Inherited from ImageOptionsBase.)
Public propertyResolutionSettings
Gets or sets the resolution settings.
(Overrides ImageOptionsBaseResolutionSettings.)
Public propertyResolutionUnit
Gets or sets the resolution unit.
Public propertyRowsPerStrip
Gets or sets the rows per strip.
Public propertySampleFormat
Gets or sets the sample format.
Public propertySamplesPerPixel
Gets the samples per pixel. To change this property value use the BitsPerSample property setter.
Public propertyScannerManufacturer
Gets or sets the scanner manufacturer.
Public propertyScannerModel
Gets or sets the scanner model.
Public propertySmaxSampleValue
Gets or sets the max sample value. The value has a field type which best matches the sample data (Byte, Short or Long type).
Public propertySminSampleValue
Gets or sets the min sample value. The value has a field type which best matches the sample data (Byte, Short or Long type).
Public propertySoftwareType
Gets or sets the software type.
Public propertySource
Gets or sets the source to create image in.
(Inherited from ImageOptionsBase.)
Public propertyStripByteCounts
Gets or sets the strip byte counts.
Public propertyStripOffsets
Gets or sets the strip offsets.
Public propertySubFileType
Gets or sets a general indication of the kind of data contained in this subfile.
Public propertyTags
Gets or sets the tags.
Public propertyTargetPrinter
Gets or sets the target printer.
Public propertyThreshholding
Gets or sets the threshholding.
Public propertyTileByteCounts
Gets or sets the tile byte counts.
Public propertyTileLength
Gets ot sets tile length.
Public propertyTileOffsets
Gets or sets the tile offsets.
Public propertyTileWidth
Gets ot sets tile width.
Public propertyTotalPages
Gets the total pages.
Public propertyValidTagCount
Gets the valid tag count. This is not the total tags count but the number of tags which may be preserved.
Public propertyVectorRasterizationOptions
Gets or sets the vector rasterization options.
(Inherited from ImageOptionsBase.)
Public propertyXmpData
Gets or sets the XMP metadata container.
(Overrides ImageOptionsBaseXmpData.)
Public propertyXPAuthor
Gets or sets image author, which used by Windows Explorer.
Public propertyXPComment
Gets or sets comment on image, which used by Windows Explorer.
Public propertyXPKeywords
Gets or sets subject image, which used by Windows Explorer.
Public propertyXposition
Gets or sets the x position.
Public propertyXPSubject
Gets or sets information about image, which used by Windows Explorer.
Public propertyXPTitle
Gets or sets information about image, which used by Windows Explorer.
Public propertyXresolution
Gets or sets the x resolution.
Public propertyYCbCrCoefficients
Gets or sets the YCbCrCoefficients.
Public propertyCode exampleYCbCrSubsampling
Gets or sets the subsampling factors for YCbCr photometric.
Public propertyYposition
Gets or sets the y position.
Public propertyYresolution
Gets or sets the y resolution.
Methods
  NameDescription
Public methodAddTag
Adds a new tag.
Public methodAddTags
Adds the tags.
Public methodClone
Clones this instance.
(Inherited from ImageOptionsBase.)
Public methodCode exampleDispose
Disposes the current instance.
(Inherited from DisposableObject.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize (Inherited from DisposableObject.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetTagByType
Gets the instance of the tag by type.
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Public methodStatic memberGetValidTagsCount
Gets the valid tags count.
Public methodIsTagPresent
Determines whether tag is present in the options or not.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodReleaseManagedResources
Releases the managed resources. Make sure no unmanaged resources are released here, since they may have been already released.
(Inherited from ImageOptionsBase.)
Protected methodReleaseUnmanagedResources
Releases the unmanaged resources. Make sure no managed resources are released here, since they may have been already released.
(Inherited from DisposableObject.)
Public methodRemoveTag
Removes the tag.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValidate
Validates if options have valid combination of tags
Protected methodVerifyNotDisposed
Verifies that the current instance is not disposed.
(Inherited from DisposableObject.)
Fields
  NameDescription
Protected fieldxmpData
XMP metadata of image.
(Inherited from ImageOptionsBase.)
Examples
This example demonstrates the use of different classes from SaveOptions Namespace for export purposes. An image of type Gif is loaded into an instance of Image and then exported out to several formats.
[C#]

string dir = "c:\\temp\\";

//Load an existing image (of type Gif) in an instance of Image class
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
{
    //Export to BMP file format using the default options
    image.Save(dir + "output.bmp", new Aspose.Imaging.ImageOptions.BmpOptions());

    //Export to JPEG file format using the default options
    image.Save(dir + "output.jpg", new Aspose.Imaging.ImageOptions.JpegOptions());

    //Export to PNG file format using the default options
    image.Save(dir + "output.png", new Aspose.Imaging.ImageOptions.PngOptions());

    //Export to TIFF file format using the default options
    image.Save(dir + "output.tif", new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default));
}
Examples
The following example shows how to convert a multipage vector image to TIFF format in general way without referencing to a particular image type.
[C#]

string dir = "C:\\aspose.imaging\\net\\misc\\ImagingReleaseQATester\\Tests\\testdata\\2548";
string inputFilePath = System.IO.Path.Combine(dir, "Multipage.cdr");
string outputFilePath = System.IO.Path.Combine(dir, "Multipage.cdr.tiff");

Aspose.Imaging.ImageOptionsBase exportOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputFilePath))
{
    exportOptions.MultiPageOptions = null;

    // Export only first two pages. These pages will be presented as frames in the output TIFF.
    Aspose.Imaging.IMultipageImage multipageImage = image as Aspose.Imaging.IMultipageImage;
    if (multipageImage != null && (multipageImage.Pages != null && multipageImage.PageCount > 2))
    {
        exportOptions.MultiPageOptions = new Aspose.Imaging.ImageOptions.MultiPageOptions(new Aspose.Imaging.IntRange(0, 2));
    }

    if (image is Aspose.Imaging.VectorImage)
    {
        exportOptions.VectorRasterizationOptions = (Aspose.Imaging.ImageOptions.VectorRasterizationOptions)image.GetDefaultOptions(new object[] { Aspose.Imaging.Color.White, image.Width, image.Height });
        exportOptions.VectorRasterizationOptions.TextRenderingHint = Aspose.Imaging.TextRenderingHint.SingleBitPerPixel;
        exportOptions.VectorRasterizationOptions.SmoothingMode = Aspose.Imaging.SmoothingMode.None;
    }

    image.Save(outputFilePath, exportOptions);
}
Examples
This examples make use of GraphicsPath and Graphics class to create and manipulate Figures on an Image surface. Example creates a new Image (of type Tiff), clears the surface and draws paths with the help of GraphicsPath class. At the end DrawPath method exposed by Graphics class is called to render the paths on surface.
[C#]

//Create an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.tiff", System.IO.FileMode.Create))
{
    //Create an instance of TiffOptions and set its various properties
    Aspose.Imaging.ImageOptions.TiffOptions tiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);

    //Set the source for the instance of ImageOptions
    tiffOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);

    //Create an instance of Image 
    using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(tiffOptions, 500, 500))
    {
        //Create and initialize an instance of Graphics class
        Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);

        //Clear Graphics surface
        graphics.Clear(Color.Wheat);

        //Create an instance of GraphicsPath class
        Aspose.Imaging.GraphicsPath graphicspath = new Aspose.Imaging.GraphicsPath();

        //Create an instance of Figure class
        Aspose.Imaging.Figure figure = new Aspose.Imaging.Figure();

        //Add Shapes to Figure object
        figure.AddShape(new Aspose.Imaging.Shapes.RectangleShape(new Aspose.Imaging.RectangleF(10f, 10f, 300f, 300f)));
        figure.AddShape(new Aspose.Imaging.Shapes.EllipseShape(new Aspose.Imaging.RectangleF(50f, 50f, 300f, 300f)));
        figure.AddShape(new Aspose.Imaging.Shapes.PieShape(new Aspose.Imaging.RectangleF(new Aspose.Imaging.PointF(250f, 250f), new Aspose.Imaging.SizeF(200f, 200f)), 0f, 45f));

        //Add Figure object to GraphicsPath
        graphicspath.AddFigure(figure);

        //Draw path with Pen object of color Black
        graphics.DrawPath(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), graphicspath);

        // save all changes.
        image.Save();
    }
}
See Also