- Aurigma Graphics Mill 5.5 for .NET
- Introduction
- What's New?
- Overview of Features
- Getting Started
- Programming with Graphics Mill for .NET
- File Formats
- Graphics Mill for .NET Add-ons
- Class Library Reference
- Aurigma.GraphicsMill Namespace
- Aurigma.GraphicsMill.AjaxControls Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.RedoUndo Namespace
- Aurigma.GraphicsMill.Codecs Namespace
- AdobeResourceBlock Class
- AdobeResourceDictionary Class
- AdvancedPsdFrame Class
- AdvancedPsdReader Class
- AdvancedPsdTextFrame Class
- AsfIndexer Class
- AviAlphaTransition Class
- AviAudioManager Class
- AviCompressor Class
- AviCustomTransition Class
- AviDrawTransitionEventArgs Class
- AviDrawTransitionEventHandler Delegate
- AviDrawWatermarkEventArgs Class
- AviDrawWatermarkEventHandler Delegate
- AviEncoderOptions Class
- AviFrame Class
- AviReader Class
- AviStripesTransition Class
- AviStripesTransitionMode Enumeration
- AviTimerStyle Enumeration
- AviTransition Class
- AviWatermark Class
- AviWriter Class
- BmpEncoderOptions Class
- BmpFrame Class
- BmpReader Class
- BmpWriter Class
- CompressionType Enumeration
- CustomEncoderOptions Class
- CustomFormatReader Class
- CustomFormatReader.LoadingMode Enumeration
- CustomFormatWriter Class
- CustomFrame Class
- DisposalMethod Enumeration
- DSEncoderOptions Class
- DSFrame Class
- DSPreLoadedFrame Class
- DSReader Class
- EncoderOptions Class
- ExifDictionary Class
- ExifItemInfo Structure
- FormatManager Class
- FormatReader Class
- FormatWriter Class
- Frame Class
- GifEncoderOptions Class
- GifFrame Class
- GifReader Class
- GifWriter Class
- ID3LyricsContentType Enumeration
- ID3LyricsTimestampFormat Enumeration
- ID3SynchronisedLyrics Class
- IEncoderOptions Interface
- IFormatInfo Interface
- IFormatReader Interface
- IFormatWriter Interface
- IFrame Interface
- IFrameEnumerator Interface
- IMediaProcessorMetadataReadSupport Interface
- IMetadataReadSupport Interface
- IMetadataWriteSupport Interface
- IptcDictionary Class
- ITimeReader Interface
- ITimeWriter Interface
- IXmpDictionary Interface
- Jpeg2kEncoderOptions Class
- Jpeg2kFrame Class
- Jpeg2kProgressionOrder Enumeration
- Jpeg2kReader Class
- Jpeg2kWriter Class
- JpegAlignToSampleSizeMode Enumeration
- JpegEncoderOptions Class
- JpegFrame Class
- JpegMarkerException Class
- JpegReader Class
- JpegWriter Class
- LosslessJpegTransform Class
- MediaCorruptedException Class
- MediaFormatManager Class
- MediaProcessorMetadataDictionary Class
- MediaProviderException Class
- MediaUnsupportedException Class
- MetadataDictionary Class
- MetadataEnumerator Class
- MultiFrameException Class
- PcxEncoderOptions Class
- PcxFrame Class
- PcxReader Class
- PdfEncoderOptions Class
- PdfFrame Class
- PdfWriter Class
- PngEncoderOptions Class
- PngFrame Class
- PngReader Class
- PngWriter Class
- PreLoadedFrame Class
- PsdEncoderOptions Class
- PsdFrame Class
- PsdFrameType Enumeration
- PsdReader Class
- PsdTextJustification Enumeration
- QTEncoderOptions Class
- QTFrame Class
- QTReader Class
- SwfEncoderOptions Class
- SwfFrame Class
- SwfWriter Class
- TiffChannelType Enumeration
- TiffEncoderOptions Class
- TiffExtraChannel Class
- TiffExtraChannelCollection Class
- TiffFrame Class
- TiffReader Class
- TiffWriter Class
- WbmpEncoderOptions Class
- WbmpFrame Class
- WbmpReader Class
- WbmpWriter Class
- WMEncoderOptions Class
- WMFrame Class
- WMPreLoadedFrame Class
- WMReader Class
- XmpArrayNode Class
- XmpData Class
- XmpDictionaryNode Class
- XmpLocalizedTextItemNode Class
- XmpLocalizedTextNode Class
- XmpNamespace Class
- XmpNode Class
- XmpNodeType Enumeration
- XmpStructNode Class
- XmpTagNames Class
- XmpValueNode Class
- Aurigma.GraphicsMill.Drawing Namespace
- Aurigma.GraphicsMill.Licensing Namespace
- Aurigma.GraphicsMill.Transforms Namespace
- Aurigma.GraphicsMill.WebControls Namespace
- Aurigma.GraphicsMill.WinControls Namespace
- GraphicsMill Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.RedoUndo Namespace (Client Class Library)
- Samples
- Licensing
- Copyright Notices
TiffWriter Class
This class enables you to write TIFF images.
Namespace:
Aurigma.GraphicsMill.Codecs
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Syntax
Public NotInheritable Class TiffWriter _
Inherits FormatWriter _
Implements IMetadataWriteSupport
public sealed class TiffWriter : FormatWriter, IMetadataWriteSupport
Remarks
TIFF format is one of the most comprehensive image formats. It was designed to promote the interchange of digital image data. The general scenario TIFF format was invented for, assumes that scanning or painting software creates a TIFF file, which can then be read and incorporated into a document or publication by an application such as a desktop publishing package. It is also widely used to retrieve facsimile messages.
This image format is rather versatile and have a lot of modifications. It supports most Graphics Mill for .NET pixel formats even such exotic ones like Format80bppAcmyk. It also can store multiple images in the single file (mostly used for fax images and other documents stored as 1-bit bitmaps).
TIFF files can also contain Adobe® resources, XMP, EXIF and IPTC data.
Examples
You can use TiffWriter class instead of the Save(String, IEncoderOptions) method of the Bitmap. In particular it enables you to save the image asynchronously.
The TiffWriter class usage is demonstrated below:
Dim dir As String = "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\"
Dim images As String() = {"Blue hills.jpg", "Sunset.jpg", "Water lilies.jpg", "Winter.jpg"}
Dim bitmap As New Aurigma.GraphicsMill.Bitmap
Dim writer As New Aurigma.GraphicsMill.Codecs.TiffWriter("C:\multipage.tif")
For Each image As String In images
bitmap.Load(dir & image)
Dim frame As New Aurigma.GraphicsMill.Codecs.TiffFrame
frame.Compression = Aurigma.GraphicsMill.Codecs.CompressionType.Lzw
frame.SetBitmap(bitmap)
writer.AddFrame(frame)
frame.Dispose()
Next
bitmap.Dispose()
writer.Dispose()
string dir = @"C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\";
String[] images = {"Blue hills.jpg", "Sunset.jpg", "Water lilies.jpg", "Winter.jpg"};
using (Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap())
{
using(Aurigma.GraphicsMill.Codecs.TiffWriter writer =
new Aurigma.GraphicsMill.Codecs.TiffWriter(@"C:\multipage.tif"))
{
foreach (string image in images)
{
bitmap.Load(dir + image);
using (Aurigma.GraphicsMill.Codecs.TiffFrame frame =
new Aurigma.GraphicsMill.Codecs.TiffFrame())
{
frame.Compression = Aurigma.GraphicsMill.Codecs.CompressionType.Lzw;
frame.SetBitmap(bitmap);
writer.AddFrame(frame);
}
}
}
}
TIFF files can store EXIF and IPTC data blocks. Graphics Mill for .NET allows you extracting this data from the TIFF file and save it into another TIFF file (as well as into the other file format which supports EXIF and IPTC). This code sample demonstrates how to add the EXIF and IPTC data to the file:
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("c:\Mountain.jpg")
Dim writer As New Aurigma.GraphicsMill.Codecs.TiffWriter("C:\Mountain.tif")
'EXIF
Dim exif As New Aurigma.GraphicsMill.Codecs.ExifDictionary
exif(Aurigma.GraphicsMill.Codecs.ExifDictionary.Software) = "Aurigma Graphics Mill"
writer.Exif = exif
'IPTC
Dim iptc As New Aurigma.GraphicsMill.Codecs.IptcDictionary
iptc(Aurigma.GraphicsMill.Codecs.IptcDictionary.Category) = "Nature"
iptc(Aurigma.GraphicsMill.Codecs.IptcDictionary.CopyrightNotice) = "Aurigma Inc."
iptc(Aurigma.GraphicsMill.Codecs.IptcDictionary.Keyword) = "mountain"
writer.Iptc = iptc
'Adobe resource blocks
Dim adobeResources As New Aurigma.GraphicsMill.Codecs.AdobeResourceDictionary
'Create new adobe image resource block with the required metadata
Dim arBlock As New Aurigma.GraphicsMill.Codecs.AdobeResourceBlock("Copyright", New Byte() {1})
'Set this block to the item with 0x040A ID (copyright flag)
adobeResources.Item(&H40A) = arBlock
writer.AdobeResources = adobeResources
'XMP
Dim xmp As New Aurigma.GraphicsMill.Codecs.XmpData()
'Create a node with the required metadata
Dim node As New Aurigma.GraphicsMill.Codecs.XmpValueNode( _
Aurigma.GraphicsMill.Codecs.XmpNodeType.SimpleProperty, _
"John Doe", _
Aurigma.GraphicsMill.Codecs.XmpTagNames.DCCreator)
xmp.AddNode(node)
writer.Xmp = xmp.Save()
Dim frame As New Aurigma.GraphicsMill.Codecs.TiffFrame(50)
frame.SetBitmap(bitmap)
bitmap.Dispose()
writer.AddFrame(frame)
frame.Dispose()
writer.Dispose()
using (Aurigma.GraphicsMill.Bitmap bitmap =
new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg"))
{
using (Aurigma.GraphicsMill.Codecs.TiffWriter writer =
new Aurigma.GraphicsMill.Codecs.TiffWriter(@"C:\Mountain.tif"))
{
//EXIF
Aurigma.GraphicsMill.Codecs.ExifDictionary exif =
new Aurigma.GraphicsMill.Codecs.ExifDictionary();
exif[Aurigma.GraphicsMill.Codecs.ExifDictionary.Software] = "Aurigma Graphics Mill";
writer.Exif = exif;
//IPTC
Aurigma.GraphicsMill.Codecs.IptcDictionary iptc =
new Aurigma.GraphicsMill.Codecs.IptcDictionary();
iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.Category] = "Nature";
iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.CopyrightNotice] = "Aurigma Inc.";
iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.Keyword] = "mountain";
writer.Iptc = iptc;
//Adobe resource blocks
Aurigma.GraphicsMill.Codecs.AdobeResourceDictionary adobeResources =
new Aurigma.GraphicsMill.Codecs.AdobeResourceDictionary();
//Create new adobe image resource block with the required metadata
Aurigma.GraphicsMill.Codecs.AdobeResourceBlock arBlock = new
Aurigma.GraphicsMill.Codecs.AdobeResourceBlock("Copyright", new byte[] { 1 });
//Set this block to the item with 0x040A ID (copyright flag)
adobeResources[0x040A] = arBlock;
writer.AdobeResources = adobeResources;
//XMP
Aurigma.GraphicsMill.Codecs.XmpData xmp = new Aurigma.GraphicsMill.Codecs.XmpData();
//Create a node with the required metadata
Aurigma.GraphicsMill.Codecs.XmpValueNode node = new
Aurigma.GraphicsMill.Codecs.XmpValueNode(
Aurigma.GraphicsMill.Codecs.XmpNodeType.SimpleProperty,
"John Doe",
Aurigma.GraphicsMill.Codecs.XmpTagNames.DCCreator);
xmp.AddNode(node);
writer.Xmp = xmp.Save();
using (Aurigma.GraphicsMill.Codecs.TiffFrame frame =
new Aurigma.GraphicsMill.Codecs.TiffFrame(50))
{
frame.SetBitmap(bitmap);
writer.AddFrame(frame);
}
}
}
Inheritance Hierarchy
Thread Safety
Static members of this type are safe for multi-threaded operations. Instance members of this type are safe for multi-threaded operations.Object Model











Supported Pixel Formats
| Member Name | Description |
|---|---|
| Format1bppIndexed | 1 bit per pixel. Indexed. |
| Format4bppIndexed | 4 bits per pixel. Indexed. |
| Format8bppIndexed | 8 bits per pixel. Indexed. |
| Format8bppGrayScale | 8 bits per pixel. Grayscale. 8 bits are used for luminosity level. |
| Format16bppGrayScale | 16 bits per pixel. Grayscale. All 16 bits are used for luminosity level (extended pixel format). |
| Format16bppAGrayScale | 16 bits per pixel. Grayscale with alpha channel. 8 bits are used for alpha channel and other 8 bits are used for luminosity level. |
| Format32bppAGrayScale | 32 bits per pixel. Grayscale with alpha channel. 16 bits are used for alpha channel and other 16 bits are used for luminosity level (extended pixel format). |
| Format24bppRgb | 24 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components. |
| Format32bppRgb | 32 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components. The rest 8 bits are unused. |
| Format32bppArgb | 32 bits per pixel. RGB with alpha channel. 8 bits each are used for the alpha, red, green, and blue components. |
| Format48bppRgb | 48 bits per pixel. RGB. 16 bits each are used for the red, green, and blue components (extended pixel format). |
| Format64bppArgb | 64 bits per pixel. RGB with alpha channel. 16 bits each are used for the alpha, red, green, and blue components (extended pixel format). |
| Format32bppCmyk | 32 bits per pixel. CMYK. 8 bits each are used for the cyan, magenta, yellow, and black components. |
| Format40bppAcmyk | 40 bits per pixel. CMYK with alpha channel. 8 bits each are used for the alpha, cyan, magenta, yellow, and black components. |
| Format64bppCmyk | 64 bits per pixel. CMYK. 16 bits each are used for the cyan, magenta, yellow, and black components (extended pixel format). |
| Format80bppAcmyk | 80 bits per pixel. CMYK with alpha channel. 16 bits each are used for the alpha, cyan, magenta, yellow, and black components (extended pixel format). |