其他具体的代码基础看前面:http://blog.csdn.net/cutter_point/article/details/42839071
void ShowMirrorVertical(); //垂直镜像 void ShowMirrorHorizontal(); //水平镜像
//实现图像镜像的动作 //纵向 mirrorVerticalAction = new QAction(QIcon("mirrorVertical.png"), tr("mirrorVertical"), this); mirrorVerticalAction->setStatusTip(tr("mirrorVertical the image")); connect(mirrorVerticalAction, SIGNAL(triggered()), this, SLOT(ShowMirrorVertical())); //横向 mirrorHorizontalAction = new QAction(QIcon("mirrorHorizontal.png"), tr("mirrorHorizontal"), this); mirrorHorizontalAction->setStatusTip(tr("mirrorHorizontal the image")); connect(mirrorHorizontalAction, SIGNAL(triggered()), this, SLOT(ShowMirrorHorizontal()));
//水平镜像 void ImageProcessor::ShowMirrorVertical() { if(img.isNull()) return; img = img.mirrored(true, false); //水平镜像 showWidget->imageLabel->setPixmap(QPixmap::fromImage(img)); } //垂直镜像 void ImageProcessor::ShowMirrorVertical() { if(img.isNull()) return; img = img.mirrored(false, true); //垂直镜像 showWidget->imageLabel->setPixmap(QPixmap::fromImage(img)); }
好吧,不知道又发生了什么,图片传不上来,那就省了吧,反正就是vertical就是上下颠倒,horizontal就是水平横移的效果!!!,
原文地址:http://blog.csdn.net/cutter_point/article/details/42875669