Export PNG Paletted (8-bit) optimized Floyd-Steinberg


Attached is an image of the export options I want to execute with my macro. This is my function and it's ingnoring the palette options. Anyone who can I help me? Image has to be png, transparent,t 8 bit.

Public Sub Export8Bit(ByVal filepath As String, ByVal filename As String, ByVal selectionRange As ShapeRange, ByVal scaleFactor As Double)
    Dim opt                   As New StructExportOptions
    Dim x                     As Double
    Dim y                     As Double
    Dim pal                   As New StructPaletteOptions

    ActiveDocument.Unit = cdrPixel
    opt.AntiAliasingType = cdrNormalAntiAliasing
    opt.ImageType = cdrRGBColorImage
    opt.Overwrite = True
    opt.ResolutionX = 96
    opt.ResolutionY = 96
    opt.Transparent = True
    opt.UseColorProfile = False
    opt.MaintainAspect = True
    pal.DitherType = cdrDitherFloyd
    pal.NumColors = 128
    pal.PaletteType = cdrPaletteOptimized
    pal.DitherIntensity = 100

    Set selectionRange = DeleteGuidelines(selectionRange)

    selectionRange.GetSize x, y
    opt.SizeX = x * scaleFactor
    opt.SizeY = y * scaleFactor

    ActiveDocument.Export filepath & filename & ".png", cdrPNG, cdrSelection, opt, pal
End Sub

No Data
Reply Children
No Data