qpixmap scaled
时间: 2023-08-06 14:04:28 浏览: 134
QPixmap的scaled()函数是用来对图片进行缩放的。在引用\[1\]中的代码中,使用了pixmap.scaled(width(), height())来对图片进行缩放,然后将缩放后的图片设置为ui->imageWidget的背景。而在引用\[2\]中的修改后的代码中,直接将缩放后的图片设置为ui->imageWidget的背景,省略了中间的临时变量。\[1\]\[2\]
#### 引用[.reference_title]
- *1* *2* [QPixmap使用scaled()函数缩放失败](https://blog.csdn.net/TianYanRen111/article/details/119752967)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Qt:22---Pixmap](https://blog.csdn.net/qq_41453285/article/details/90372575)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文