I'm trying to capture the screen into a CGImage object.
The code I'm converting originally called
cgImage = CGDisplayCreateImage(_displayId);
I don't see a direct replacement for that in Xamarin, so instead I'm trying:
CGRect rect = CGDisplay.GetBounds(_displayId); cgImage = CGImage.ScreenImage(_displayId, rect);
I assume the _displayId is correct because I get a rect back 1680x1050
It's retrieved using
CGRect rect = CGDisplay.GetBounds(_displayId);
Is there some initializer call I'm missing? Or some alternative call I can make to get a CGImage back of the screen?
Alternatively, can anyone show me what the signature would look like to DllImport this one?
CG_EXTERN CGImageRef __nullable CGDisplayCreateImage(CGDirectDisplayID displayID)?