Search code examples
c#transparencytiffpdfsharp

C# PDFsharp: TIFF images drawn without transparency


When rendering a TIFF image like this (C# and PDFsharp)

XGraphics gfx = XGraphics.FromPdfPage(page);
XImage myImg = XImage.FromStream(myImgStream);
gfx.DrawImage( myImg, x, y, s, w );

the image is drawn without transparency. I tried loading the image from file too (XImage.FromFile(myPath)). If I do the same with a PNG image transparency is drawn correctly. Am I missing something?

EDIT:

Link to sample image: https://ibin.co/4iBXM9W5hW1l

PDFsharp build is WPF. I haven't tried GDI.


Solution

  • My image did not store the transparency information - which I just recognized...