tags:

views:

59

answers:

1

I have a bunch of monochrome (1bpp) PNG images I want to load, and pass to pdfSharp.

Using Image.FromFile loads images fine, but it alawys uses 32BPP, regardless of the pixel depth of the file. That results in very large PDF files generated.

Is there a way to load images in their native pixel depth?

A: 

Hi,

This article on Bytes seems to get at what you are trying to do. Also, this msdn doc on PixelFormat.BitsPerPixel should be useful.

Hope this helps!

Irfy
This does not help on detecting pixel depth on existing file.
extropy