A
A
Alexander2018-04-19 21:58:03
Python
Alexander, 2018-04-19 21:58:03

Objects in python, interaction between objects, and operations on objects how easy is it to understand?

Hello to everyone present.
I'm not new to Python, I've been studying for about 3 years, so to speak, this is my hobby, I won't hide a lot, I learned it myself, through my own mistakes.
I'll give you a script:

import sys
from time import sleep
from threading import Thread 
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel
from PyQt5.QtGui import QPixmap, QImage
from PyQt5.QtCore import Qt, QSize, QTimer
from PIL import Image, ImageQt

class PhotoShow(QMainWindow):
    def __init__(self):
        
        super().__init__()
        self.initApp()
        self.show()
        
    def initApp(self):
        self.setWindowTitle("Просмотр изображений")
        self.setGeometry(200, 200, 1000, 800)

        self.im = Image.open('image.jpg')
        self.im.rotate(78)
        
        self.width, self.height = self.im.size

        self.image = ImageQt.ImageQt(self.im)

        self.pixmap = QPixmap(QImage(self.image))

        # self.resize(self.width, self.height)
        
        # self.image = ImageQt.ImageQt(self.im)
        
        #self.pixmap = QPixmap(QImage(self.image))

        self.label = QLabel(self)
        self.label.setGeometry(0, 0, self.width, self.height)
        self.label.setPixmap(self.pixmap)

        # self.timer = QTimer(self)
        # self.timer.timeout.connect(self.update_)
        # self.timer.start(3000)

if __name__ == "__main__":
    app = QApplication(sys.argv)
    _ = PhotoShow()
    sys.exit(app.exec_())

How can I visually rotate an image 360 ​​degrees?
And more or less explain the interaction of objects

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question