Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在使用以下代码截取窗口的屏幕截图(句柄类型为 HWND):
QPixmap::grabWindow((WId) handle).save("haystack.png", "png");
但是,我只需要对窗口的某个区域(矩形)进行截图。
就我而言,矩形具有以下顶点:
左上角:(536, 535)
右下角:(778, 592)
就在文档中:
QPixmap QPixmap::grabWindow( WId window, int x = 0, int y = 0, int width = -1, int height = -1 );