When I show a specific image in a PictureBox (or Cyotek's ImageBox in my case, doesn't matter), the color gets a little washed out. Most images displays correctly but some few images gets washed out.
Here's what it looks like:
The original image
Opened in Windows Photo Viewer
Opened in my application
I tried loading the image in 3 different ways, but same result:
Image image = GetImage(OPEN);
imgBox.Image = image;
public Image GetImage(string path)
{
Image image = null;
//image = Image.FromFile(@"D:Visual Studiopicturespokemon.jpg"); // washed out colors
try
{
using (FileStream file_stream = new FileStream(path, FileMode.Open, FileAccess.Read)) // washed out colors
{
MemoryStream memory_stream = new MemoryStream();
file_stream.CopyTo(memory_stream);
image = Image.FromStream(memory_stream, false, false);
file_stream.Dispose();
}
}
catch
{
try
{
FIBITMAP picture = FreeImage.LoadEx(path); // washed out colors
Bitmap bitmap = FreeImage.GetBitmap(picture);
image = bitmap;
FreeImage.Unload(picture);
}
catch { }
}
return image;
}
Anyone know why this is? Maybe some specific tag in this image that Windows and PictureBox handles differently?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…