This class holds PNG encoder options.
Namespace:
Aurigma.GraphicsMill.Codecs
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public NotInheritable Class PngEncoderOptions _ Inherits EncoderOptions
public sealed class PngEncoderOptions : EncoderOptions
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.
The code below converts the JPEG file into the PNG. It also demonstrates how to change PNG encoder settings.
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("c:\Mountain.jpg") bitmap.Save("C:\Mountain.png", _ New Aurigma.GraphicsMill.Codecs.PngEncoderOptions(True)) bitmap.Dispose()
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.
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))
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)); }