Image Transparency

The PNG image format support transparency. To accomplish adding transparency to an image, define the appropriate ImageFormat with a ColorFormat of type RGBA. This produces a rasterized image that contains transparency.

The following example illustrates adding transparency to a PNG. It uses the PngImageFormat and PngColorFormat classes, and the PdfRasterizer class's Draw method.

PdfRasterizer rasterizer = new PdfRasterizer(pdfFilePath);
PngImageFormat png = new PngImageFormat(PngColorFormat.RgbA);
rasterizer.Draw(pngFilePath, png, ImageSize.Dpi72);        
Dim MyRasterizer As PdfRasterizer = New PdfRasterizer(pdfFilePath)
Dim MyPng As PngImageFormat = New PngImageFormat(PngColorFormat.RgbA)
MyRasterizer.Draw(pngFilePath, MyPng, ImageSize.Dpi72) 

In this topic