Mirroring the image function
Other specific code bases look ahead: http://blog.csdn.net/cutter_point/article/details/42839071
Slot function:
void Showmirrorvertical (); Vertical mirror void showmirrorhorizontal (); Horizontal mirroring
The corresponding response connection
Implementation of image Mirroring action //portrait mirrorverticalaction = new Qaction (Qicon ("Mirrorvertical.png"), tr ("Mirrorvertical"), this ); Mirrorverticalaction->setstatustip (TR ("mirrorvertical the Image"); Connect (mirrorverticalaction, SIGNAL (triggered ()), this, SLOT (Showmirrorvertical ())); Transverse mirrorhorizontalaction = new Qaction (Qicon ("Mirrorhorizontal.png"), tr ("Mirrorhorizontal"), this); Mirrorhorizontalaction->setstatustip (TR ("Mirrorhorizontal the Image"); Connect (mirrorhorizontalaction, SIGNAL (triggered ()), this, SLOT (Showmirrorhorizontal ()));
The implementation of the slot function:
Horizontal mirror void imageprocessor::showmirrorvertical () { if (Img.isnull ()) return; img = Img.mirrored (true, false); Horizontal mirroring Showwidget->imagelabel->setpixmap (Qpixmap::fromimage (IMG));} Vertical mirror void imageprocessor::showmirrorvertical () { if (Img.isnull ()) return; img = img.mirrored (false, true); Vertical Mirror showwidget->imagelabel->setpixmap (Qpixmap::fromimage (IMG));}
Operation Result:
Well, do not know what happened, the picture can not get up, then save it, anyway is vertical is upside down, horizontal is the effect of horizontal transverse shift!!! ,
"QT5 Development and examples" 15. Implement a simple text editor 4