调用系统截屏

#include
#include
#include
#include

void MySleep(int second)
{
    QTime t;
    t.start();
    while (t.elapsed() < second)
        QCoreApplication::processEvents();
}

int main(int argc, char *argv[])

{

    keybd_event(VK_SNAPSHOT, 0, 0, 0);

    MySleep(10);
    QApplication::clipboard()->image().save("F:/a.jpg", "jpg");

    return 0;

}

你可能感兴趣的:(调用系统截屏)