I am developing Mac desktop application, where I am capturing the screen using
CGImageRef screenShot = CGWindowListCreateImage(CGRectInfinite, kCGWindowListOptionAll, kCGNullWindowID, kCGWindowImageDefault);
The problem is, I am expecting it should show the mouse cursor too, but it’s not showing.
Do I need to enable any settings for that?
I tried the following before calling this function:
CGDisplayShowCursor(kCGDirectMainDisplay);
CGAssociateMouseAndMouseCursorPosition(true);
, but it didn’t work.
When I checked using following
bool bCursor = CGCursorIsDrawnInFramebuffer(); /* This returns false */
bCursor = CGCursorIsVisible(); /* This returns true */
, te value says the cursor was not drawn in the frame buffer, however the cursor is visible.
I suppose I only need to do is to draw the cursor in the frame buffer, how do I do this?.
it seems, framebuffer doesn’t give me the mouse cursor, so i am drawing my own, this is the code snippet , might be help full to you guys,