Wednesday, February 10, 2016

PNG's and DPI's

PNG's are a web image format, and as such try to be independent of the device dpi so you can set the resolution and image size in your css or let the browser handle it. However, we use pngs for some desktop applications. Because of inconsistent dpi settings on different pngs we had some weird behavior where wpf was blowing up our save icons, but not our open file icons. The result in wpf was to set the width, height, and stretch attributes to our image element manually, as well as the SnapsToPixels to true for antialiasing (though at that image size I couldn't see the difference).

To be sure the png's had different dpi's and that was the problem, I had to install gimp, open the png, look at the image properties and the resolution. It would have been nice if this was just in the details tab of the properties window of the image, but if I'm right that png's don't worry about dpi it would make sense that dpi is excluded there.

No comments:

Post a Comment