Pixel size of ImageSource

c#, image, wpf

Solution

You have to multiply the value with Windows's DPI resolution in order to obtain the amount of physical pixels. One way to get the DPI resolution is to get hold of a `Graphics` object and read its `DpiX` and `DpiY` properties.

Problem

How can I determine the size of an ImageSource in pixels? The ImageSource object has a Height and a Width property, but they return the size in 1/96 inches..

Original source

Related problems