开发者

how to capture mouse cursor in screen grab?

开发者 https://www.devze.com 2022-12-20 02:36 出处:网络
I\'m using OpenGL to grab 开发者_如何学JAVAthe contents of the Mac OSX screen - thsi works very well, except it does not grab the mouse cursor graphic. I need to somewhow get that cursor graphic, eith

I'm using OpenGL to grab 开发者_如何学JAVAthe contents of the Mac OSX screen - thsi works very well, except it does not grab the mouse cursor graphic. I need to somewhow get that cursor graphic, either as part of my screen capture routine, or separately.

My question is either:

  • How can I ensure that the mouse cursor image is included with the OpenGL screen grab?

or

  • How can I get the current mouse cursor image as a simple RGBA bitmap?

I'm developing under Mac OSX 10.6, using C++ / Carbon.

Cheers,


You can use I/O Kit to read the pixels for the current cursor. See IOFramebufferShared.h and IOGraphicsLib.h for some of the relevant API.

0

精彩评论

暂无评论...
验证码 换一张
取 消