1

我正在努力寻找NSReadPixel。好像它来自 AppKit,但我在 MonoMac 中找不到它。有人可以告诉我它是否实施了吗?

编辑:我不得不pinvoke它。声明如下。

4

1 回答 1

1

它没有被实施。所以这里是 PInvoke:

[System.Runtime.InteropServices.DllImport("/System/Library/Frameworks/AppKit.framework/AppKit")]
extern static IntPtr NSReadPixel(System.Drawing.PointF point);

例子:

var color = new NSColor(NSReadPixel(aPoint)); // where aPoint is PointF
于 2014-06-10T13:51:22.110 回答