views:

266

answers:

1

Hi.

I experienced a Problem in Visual Studio 2010 and i dont know if its a bug or i just did somehting wrong.

I have 6 Images(Icons) that all have the same size (50x60px), are of same type(png), made with same program(gimp), saved with same options. I want to use these icons as backgrounds for buttons. But the Images are scaled different, altough Stretch and TileMode are both 'None'.

Some are to big, some to small, some just right. And i dont talk about a pixel or so. They are more than half as big, or nearly double as big as they should be. I tested it with Button, Canvas and Rectangle controls.

But when i open the 'Select Image' window, or edit the pictures in Visual Studio they are all the same size. The problem exists in designer and in compiled program.

Can anyone confirm a behaviour like this? Anyone knows a way to fix it?

+2  A: 

There are not a lot of candidates for this problem. But one: a bitmap records the resolution of the device on which it was created. Typical defaults are 96 or 120 dots per inch on a Windows machine. WPF will rescale the image on the target device so it has the same size, measured in inches rather than pixels.

Sounds like your editor is gimpy, not recording the DPI properly. You can see it in mspaint.exe with the Properties command.

Hans Passant
Thanks. That was the problem. Wrong resolution was saved by gimp.
Marks