[DllImport("gdi32.dll")] private static extern uint GetPixel(IntPtr hDC, int XPos, int YPos);
Graphics g = control.CreateGraphics(); uint colorref = GetPixel(g.GetHdc(), center.X + convolution[i, j].X, center.Y + convolution[i, j].Y); // picGraphics是我用picturePox類中的CreateGraphics方法創建的Graphics對象