helo all,
i am new in VS2010 c# for windows phone 7.
i want to create a project to change color image to black and white (0 and 255), filtering end etc,
i found code for convert color to grayscale, here my code:
private void button2_Click(object sender, RoutedEventArgs e)
{
WriteableBitmap wb=new WriteableBitmap(image1, new TransformGroup());
byte a, r, g, b, max, min;
int pixel;
for (int i = 0; i < wb.Pixels.Length; i++)
{
pixel = wb.Pixels[i];
a = (byte)(pixel >> 24);
r = (byte)(pixel >> 16);
g = (byte)(pixel >> 8);
b = (byte)pixel;
max = Math.Max(r, g);
max = Math.Max(max, b);
min = Math.Min(r, g);
min = Math.Min(min, b);
pixel = (r + b + g) / 2;
wb.Pixels[i] = (pixel << 24) | (pixel << 16) | (pixel << 8);
}
image1.Source = wb;
}
with this code I can't get location in image (x,y),
I need to get pixel value by x,y location. some one help me please.
give me sample code please :D:D:D:D:D
sorry for my english.