Skip to content

Instantly share code, notes, and snippets.

@chamons
Created May 5, 2015 15:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chamons/b8c76b2019f38336a6c0 to your computer and use it in GitHub Desktop.
Save chamons/b8c76b2019f38336a6c0 to your computer and use it in GitHub Desktop.
int displayID = MainDisplayID ();
IntPtr handle = CGDisplayCreateImage (displayID);
CoreGraphics.CGImage i = ObjCRuntime.Runtime.GetINativeObject <CoreGraphics.CGImage> (handle, true);
[System.Runtime.InteropServices.DllImport ("/System/Library/Frameworks/QuartzCore.framework/QuartzCore")]
static extern IntPtr CGDisplayCreateImage (int displayID);
[System.Runtime.InteropServices.DllImport("/System/Library/Frameworks/ApplicationServices.framework/Versions/Current/ApplicationServices", EntryPoint="CGMainDisplayID")]
internal static extern int MainDisplayID();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment