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

PngEncoderOptions Class

This class holds PNG encoder options.

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

Syntax

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

Remarks

The only PNG-related option which is available is whether to make it interlaced.

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

Examples

The code below converts the JPEG file into the PNG. It also demonstrates how to change PNG encoder settings.

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

bitmap.Save("C:\Mountain.png", _
    New Aurigma.GraphicsMill.Codecs.PngEncoderOptions(True))

bitmap.Dispose()
C#
using (Aurigma.GraphicsMill.Bitmap bitmap = 
           new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg"))
{
    bitmap.Save(@"C:\Mountain.png", 
        new Aurigma.GraphicsMill.Codecs.PngEncoderOptions(true));
}

This code sample converts the image into the indexed bitmap with 32 palette entries. After that it saves this bitmap into the PNG file.

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

bitmap.ColorManagement.PaletteEntryCount = 32
bitmap.ColorManagement.ConvertToIndexed(8, Aurigma.GraphicsMill.ColorPaletteType.Adaptive, _
    Nothing)

bitmap.Save("C:\Mountain.png", _
    New Aurigma.GraphicsMill.Codecs.PngEncoderOptions(True))
C#
using (Aurigma.GraphicsMill.Bitmap bitmap = 
           new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg"))
{
    bitmap.ColorManagement.PaletteEntryCount = 32;
    bitmap.ColorManagement.ConvertToIndexed(8, Aurigma.GraphicsMill.ColorPaletteType.Adaptive, 
        null);

    bitmap.Save(@"C:\Mountain.png", 
        new Aurigma.GraphicsMill.Codecs.PngEncoderOptions(true));
}

Inheritance Hierarchy

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

Thread Safety

Static members of this type are safe for multi-threaded operations. Instance members of this type are not safe for multi-threaded operations.

Object Model




See Also

Reference