This documentation is for the old version. Go to the latest Graphics Mill docs

Jpeg2kEncoderOptions Class

This class holds possible JPEG2000 format encoder options.

Namespace: Aurigma.GraphicsMill.Codecs
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

Visual Basic
Public NotInheritable Class Jpeg2kEncoderOptions _
	Inherits EncoderOptions
C#
public sealed class Jpeg2kEncoderOptions : EncoderOptions

Remarks

JPEG2000 files can be compressed either with lossy or lossless compression algorithm. You can select it using the Compression property. When lossy compression (WaveletLossy) is used, you can specify the compression ratio using the Rate property. It can accepts values from 0 to 1, and specifies the ratio between compressed and uncompressed bitmap. E.g. you compress 1MB bitmap and specify the Rate to 0.1. As a result, you will get 100KB JPEG2000 file.

Also you can specify additional JPEG2000 encoder settings, such as tile size (TileWidth and TileHeight), as well as a progression order (ProgressionOrder).

MediaFormat property of this class always returns value that equals to Jpeg2kFormat static field of the FormatManager class. Left and Top are meaningless for JPEG2000 and always set to 0.

Examples

This code sample demonstrates how to save the JPEG2000 file with non-default encoder settings. Here we use high compression. The result file size will be only 10% from the original size:

Visual Basic
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("c:\Mountain.jpg")

bitmap.Save("C:\Mountain2.jp2", _
    New Aurigma.GraphicsMill.Codecs.Jpeg2kEncoderOptions(0.1))

bitmap.Dispose()
C#
using (Aurigma.GraphicsMill.Bitmap bitmap = 
           new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg"))
{
    bitmap.Save(@"C:\Mountain2.jp2", 
        new Aurigma.GraphicsMill.Codecs.Jpeg2kEncoderOptions(0.1f));
}

Inheritance Hierarchy

System.Object
L Aurigma.GraphicsMill.Codecs.EncoderOptions
L Aurigma.GraphicsMill.Codecs.Jpeg2kEncoderOptions

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




See Also

Reference