0
私は経験豊かな開発者ではなく、問題があります。画面をキャプチャしてXamarin.Macのファイルに保存する方法
スクリーンショットを作成してファイルに保存する方法がわかりません。
[DllImport("/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/CoreGraphics")]
private static extern IntPtr CGWindowListCreateImage(RectangleF screenBounds, CGWindowListOption windowOption, uint windowID, GWindowImageOption imageOption);
partial void ButtonClicked (Foundation.NSObject sender) {
IntPtr screenShot = CGWindowListCreateImage ((RectangleF)NSScreen.MainScreen.Frame, CGWindowListOption.IncludingWindow,
0, CGWindowImageOption.Default);
CGImage img = new CGImage(screenShot);
NSBitmapImageRep imgRep = new NSBitmapImageRep(img);
NSImage imgf = new NSImage(img, NSScreen.MainScreen.Frame.Size);
}
正常に動作しているかどうかわかりません。誰も助けることができますか?