【发布时间】:2016-07-11 02:56:20
【问题描述】:
我正在使用 qt creator 创建示例远程协助 我的项目有两部分服务器和客户端 客户端截取屏幕截图并将其发送到服务器,但截图图片质量很高,而且尺寸太大,从局域网或互联网协议发送它不是一个好主意 我需要调整图像大小或将其转换为低质量,以便几乎可以识别
这是我的截图代码
void MainWindow::shootScreen()
{
originalPixmap = QPixmap(); // clear image for low memory situations
// on embedded devices.
originalPixmap = QGuiApplication::primaryScreen()->grabWindow(0);
//emit getScreen(originalPixmap);
updateScreenshotLabel();
}
void MainWindow::updateScreenshotLabel()
{
this->ui->label_2->setPixmap(originalPixmap.scaled(this->ui->label_2- >size(),
Qt::KeepAspectRatio,
Qt::SmoothTransformation));
}
【问题讨论】: