DitheringAlgorithm Enum
- Namespace: ceTe.DynamicPDF.Rasterizer
- Assemblies: ceTe.DynamicPDF.Rasterizer.dll
Represents different dithering algorithms.
public enum DitheringAlgorithm
Public Enum DitheringAlgorithm
Inheritance: Object → ValueType → Enum → DitheringAlgorithm
Fields
| DitheringAlgorithm.Bayer | 1 | Bayer's pattern based algorithm. |
|---|---|---|
| DitheringAlgorithm.FloydSteinberg | 0 | Floyd-Steinberg diffusion kind of algorithm. |
Licensing
This class is a DynamicPDF Rasterizer feature. The following license is required for non-evaluation usage:
- DynamicPDF Rasterizer for .NET
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);
}
}