PDA

View Full Version : Screenshot example doesn't work on Mac OSX



Damiano
19th January 2011, 11:17
Hello.

I'm using SnowLeopart and Qt Designer. I have to write grabscreen application. There is desktop/screenshot example in Qt examples, but it doesn't work on Mac (first time screenshot is black, next is always blue). This example use QPixmap::grabWindow, is there any other way to do this?

Thanks,
Damiano

EDIT1:

Solved, use:


CGImageRef windowImage = CGWindowListCreateImage(imageBounds, singleWindowListOptions, windowID, imageOptions);
originalPixmap = new QPixmap(QPixmap::fromMacCGImageRef(windowImage));