C# getpixels() gets the correct value on xp and vista but is slightly off when used on windows 7
Posted
by
user352288
on Stack Overflow
See other posts from Stack Overflow
or by user352288
Published on 2010-05-27T19:09:10Z
Indexed on
2012/12/18
5:03 UTC
Read the original article
Hit count: 266
I have a C# program that works correctly on xp and vista but it needs to be used on windows 7, I have not been able to come up with a solution, it appears that getpixels just doesn't work right on windows 7.
I am getting one of the RGB values because I am dealing with tiff grayscale images.
System.Drawing.Bitmap image;// this is in a separate class
image = new Bitmap(destination);// this is in the constructor
Color t = image.GetPixel(j, i); // this is in a separate function
int s = t.R
when I print s, for example, image(0,0), it is supposed to be 220, it will be 221
I am doing edge detection on an image and I have to go through the image pixel by pixel, I have run the exact same program on XP,Vista,windows7 and windows 7 got different values.
It wouldn't let me post images at all and only one link.
The first image is the original image, the second is the correct image, also the one I get with XP and Vista, the final image is the image when running the same program in Windows 7. There is not much of a visible difference but it matters for what I am doing.
Thanks for the help, it seems that I am having a hard time explaining my problem.
© Stack Overflow or respective owner