DitheringAlgorithm Enum
Represents different dithering algorithms.
public enum DitheringAlgorithm
Public Enum DitheringAlgorithm
Inheritance: ObjectValueTypeEnumDitheringAlgorithm
Fields
DitheringAlgorithm.Bayer | 1 | Bayer's pattern based algorithm. |
DitheringAlgorithm.FloydSteinberg | 0 | Floyd-Steinberg diffusion kind of algorithm. |
DitheringAlgorithm.None | 2 | No Dithering. |
Licensing Info
This enum is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Rasterizer selected.
- A DynamicPDF Rasterizer for .NET v4.X Developer license.
Examples
This example demonstrates how to rasterize a PDF document to Gif image using FloydSteinberg dithering.Imports System
Imports ceTe.DynamicPDF.Rasterizer
Module MyModule
Sub Main()
'Create a PdfRasterizer object.
Dim rasterizer As New PdfRasterizer("InputPdfFile.pdf")
'Create a GifImageFormat object.
Dim gifImageFormat As New GifImageFormat()
'Set the DitheringAlgorithm to FloydSteinberg.
gifImageFormat.DitheringAlgorithm = DitheringAlgorithm.FloydSteinberg
'Set the size.
Dim fixedImageSize As New FixedImageSize(595, 841)
'Save the image.
rasterizer.Draw("Output.Gif", gifImageFormat, fixedImageSize)
End Sub
End Module
using System;
using ceTe.DynamicPDF.Rasterizer;
class MyClass
{
static void Main(string[] args)
{
//Create a PdfRasterizer object.
PdfRasterizer rasterizer = new PdfRasterizer("InputPdfFile.pdf");
//Create a GifImageFormat object.
GifImageFormat gifImageFormat = new GifImageFormat();
//Set the DitheringAlgorithm to FloydSteinberg.
gifImageFormat.DitheringAlgorithm = DitheringAlgorithm.FloydSteinberg;
//Set the size.
FixedImageSize fixedImageSize = new FixedImageSize(595, 841);
//Save the image.
rasterizer.Draw("Output.Gif", gifImageFormat, fixedImageSize);
}
}