![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Image scaling I have a PNG image that has DPI set to 71 but my screen has DPI set to 96. This is why WPF scales the images about 30% bigger (92/71 = 1,3) This happens even if I set Stretch to None <Page> <Image Stretch="None" Source="Sample.png"/> </Page> I want WPF to render image exactly on the width of image in pixels. How to do that? - Jaska |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Image scaling Hi, Jaska wrote: > I have a PNG image that has DPI set to 71 but my screen has DPI set to 96. > This is why WPF scales the images about 30% bigger (92/71 = 1,3) > This happens even if I set Stretch to None > > <Page> > <Image Stretch="None" Source="Sample.png"/> > </Page> > > I want WPF to render image exactly on the width of image in pixels. How to > do that? > > - Jaska You can force the width and height of the image by using the Width and Height properties. Note however that WPF doesn't use pixels as units, but "Device independent units". So if you set to a (theoretical) width of 10, it means 10/96 inches, not 10 pixels. This is designed to allow you to have your application look exactly the same whatever the user's screen resolution is set to. HTH, Laurent -- Laurent Bugnion, GalaSoft Software engineering: http://www.galasoft-LB.ch Private/Malaysia: http://mypage.bluewin.ch/lbugnion Support children in Calcutta: http://www.calcutta-espoir.ch |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| DPI Scaling | Tutorials | |||
| Scaling | Vista installation & setup | |||
| window scaling | Vista General | |||
| DPI Scaling does not work | Vista installation & setup | |||