WPF Image Color Tint
I am loading several images in WPF and from what I have read, it keeps them all in memory.
I was wondering why it is that when I display my image, that there is a red/purple tint?
Has anyone experienced this issue before?
I set up an Image
class using the Designer, then I set the Image.Source
to my ImageSourceConverter.ConvertFromString("MyFilepath.png")
I also set
Image.Stretch = Stretch.Fill (if that helps)
It see开发者_如何学编程ms that some images have a reddish discoloration to them. I cannot figure out why...?
EDIT:
I tried to post images, but stackoverflow's convenient spam prevention said I could not post them because I just joined...
Is it possible there's a translucent overlay in your XAML causing the discoloration? It could also be an encoding issue... Can you post a sample of your code?
Also, although you can't embed images directly in your post because of your newness, you could upload the image to imgur.com, for example, and post a link to that image.
Well, I found that after I changed the images from .png to .jpg, the discoloration was no longer an issue. I am wondering what might have caused this?
I do not think it was the alpha transparency of the .png's, but rather the ImageSourceConverter itself...?
This was most likely caused by dithering effect. It should go away after you set the following property on your Image element to true:
SnapsToDevicePixels = "True"
精彩评论