2012-05-02 12 views

回答

1

Bitmap.GetPixel(x, y)方法请看:

参数

X类型:检索像素的System.Int32的x坐标。 y 类型:System.Int32要检索的像素的y坐标。

返回 值

类型:的System.Drawing.Color A颜色结构,它表示该颜色的指定像素的 。

+0

image1.Source没有GetPixel(x,y)方法,因为它是ImageSource类的类型。 – Alexandre

+0

@AlexMaslakov:你可以做的是首先将'ImageSource'转换为'Bitmap',然后应用我提出的方法。你可以看看这里:http://blogs.msdn.com/b/llobo/archive/2007/03/08/bitmapsource-bitmap-interop.aspx,看看你可以从'ImageSource'转换到'Bitmap' 。 – npinti

+0

难道没有更好的办法吗? – Alexandre