Qt Qimage图片翻转(水平、垂直、顺时针、逆时针)

Qt Qimage图片翻转(水平、垂直、顺时针、逆时针)

首页休闲益智水平旋转器更新时间:2024-07-31
1、水平翻转

void ImageViewer::horFilp() { image = image.mirrored(true, false); imageLabel->setPixmap(QPixmap::fromImage(image)); }2、垂直翻转

void ImageViewer::verFilp() { image = image.mirrored(false, true); imageLabel->setPixmap(QPixmap::fromImage(image)); }3、顺时针旋转

void ImageViewer::clockwise() { QMatrix matrix; matrix.rotate(90.0); image = image.transformed(matrix,Qt::FastTransformation); imageLabel->setPixmap(QPixmap::fromImage(image)); }4、逆时针旋转

void ImageViewer::anticlockwise() { QMatrix matrix; matrix.rotate(-90.0); image = image.transformed(matrix,Qt::FastTransformation); imageLabel->setPixmap(QPixmap::fromImage(image)); }

查看全文
大家还看了
也许喜欢
更多游戏

Copyright © 2024 妖气游戏网 www.17u1u.com All Rights Reserved