1 Attachment(s)
[RESOLVED] Blurry Menu Images
Im using xmal code to create amy menu items with images, no issues other then the images are coming out all blurry (no I dont need glasses lol).
Ive tried using several types (png, bmp, ico) from the ones provided from VS but all still the same. Used 16x16 in the screen shot but if I use 32x32 the png ones are clear, just too damn large lol.
Oh and why doesnt WPF menu Icon property support icons? :lol:
Is there some property setting I need to set or ???
Thanks
Re: [RESOLVED] Blurry Menu Images
Hi.
If you save your pictures with 96DPI they should look ok. The reason WPF upscales and blurs the images is because they are probaly saved using 72DPI.
WPF always assume 96DPI. That also means your app will look wrong when displayed on a pc with a default system DPI of e.g. 120.
Re: [RESOLVED] Blurry Menu Images
Thanks pax. Yes they were the standard VS images which are 72 dpi.
Re: [RESOLVED] Blurry Menu Images
Quote:
Originally Posted by
pax
Hi.
If you save your pictures with 96DPI they should look ok. The reason WPF upscales and blurs the images is because they are probaly saved using 72DPI.
WPF always assume 96DPI. That also means your app will look wrong when displayed on a pc with a default system DPI of e.g. 120.
Technically not true, basically WPF deals with resolution by using 96dpi as its base unit of measurement. This means that your application should always look the same regardless of resolution (custom images excepted).
If you wanted to be completely anal you could specify a couple of different DPI images and run a simple check to choose which one to use. This of course only applies to raster based images.
I had heard a rumor that illustrator now has an addon to export native created (in illustrator) images to XAML so you shouldn't have that issue with images made there.
Also I have heard that a lot of icon companies are now offering illustrator based versions of their icons too so eventually you shouldn't have this problem.
Re: [RESOLVED] Blurry Menu Images
Quote:
Originally Posted by
DeanMc
Technically not true, basically WPF deals with resolution by using 96dpi as its base unit of measurement. This means that your application should always look the same regardless of resolution (custom images excepted).
If you wanted to be completely anal you could specify a couple of different DPI images and run a simple check to choose which one to use. This of course only applies to raster based images.
I had heard a rumor that illustrator now has an addon to export native created (in illustrator) images to XAML so you shouldn't have that issue with images made there.
Also I have heard that a lot of icon companies are now offering illustrator based versions of their icons too so eventually you shouldn't have this problem.
Based on this : http://www.wpflearningexperience.com/?p=41=1 it appears that WPF actually does take the dpi setting into account. The problem is, that even though an app should look the same wether run on 96dpi or 120 the reality seems to be another. True, wpf scales to the 120dpi setting, but if the monitor is not truely a 120dpi monitor, things will be off. And if your app was originally layed out to match a e.g 94dpi monitor with a dpi setting of 96dpi (like in the link), things will usually be 2% off. When designing your app, you lay things out so they match and look ok. Run that on a 120dpi setting and thing will look very different.
Anyhow... The original question was about images, and the images have to have the same dpi as the system it's run on. Meaning, that you still have to design your app with one setting in mind and hope that people won't use another setting. I know you can specify the width and height at designtime, but there are cases where images are loaded dynamically. Wpf should use the pixel size of the images instead. At least for raster images.
Re: [RESOLVED] Blurry Menu Images
What a good article. I suppose I will have to factor this in when I am designing in future. Rep+ for that!
Re: [RESOLVED] Blurry Menu Images
Great extra info.
Gonna read the article on lunch. Slave driving work wont let me gold brick lol
Re: [RESOLVED] Blurry Menu Images
Damn I just read the article and well... I feel conned! I thought WPF's resolution independence meant it would be the same on any resolution :(
Re: [RESOLVED] Blurry Menu Images
Maybe they meant that it was "independant" from being independant lol