2012-05-02 13 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