Zoom the frame on click
-
I have create a UI with the help of qt designer and access the camera on the label widget with python and now i want zoom the camera on the click of label please help.
-
I have create a UI with the help of qt designer and access the camera on the label widget with python and now i want zoom the camera on the click of label please help.
@Adarshpandey Take a look at the suggestion here: https://forum.qt.io/topic/113473/zoom-in-and-zoom-out-on-qlabel-image/2
-
can you please describe in detailed in python
-
can you please describe in detailed in python
@Adarshpandey No, I will not translate the code to Python for you. Try to do it by yourself and if something is not clear ask concrete questions...
-
To add on to @jsulm 's answer:
It seems what you're after is:
void ImageViewer::scaleImage(double factor) { scaleFactor *= factor; imageLabel->resize(scaleFactor * imageLabel->pixmap(Qt::ReturnByValue).size()); adjustScrollBar(scrollArea->horizontalScrollBar(), factor); adjustScrollBar(scrollArea->verticalScrollBar(), factor); zoomInAct->setEnabled(scaleFactor < 3.0); zoomOutAct->setEnabled(scaleFactor > 0.333); }(Function copied from https://doc.qt.io/qt-5/qtwidgets-widgets-imageviewer-example.html (the place where @jsulm pointed you to))
C++ is easy enough to convert to Python, or at least is easy to understand the concept of the function whether you know C++ or not, though I may be a bit biased as I know both languages.