Python PyQt5 IMAGES are easy! 📷

Publicado em: 25 Julho 2024
no canal de: Bro Code
13,296
216

#pythontutorial #python #pyqt5

PyQt5 images
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel
from PyQt5.QtGui import QPixmap

class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setGeometry(700, 300, 500, 500)

label = QLabel(self)
label.setGeometry(0, 0, 500, 500)

pixmap = QPixmap("profile_pic.jpg")
label.setPixmap(pixmap)

label.setScaledContents(True)

label.setGeometry((self.width() - label.width()) // 2,
(self.height() - label.height()) // 2,
label.width(),
label.height())

def main():
app = QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec_())

if _name_ == "__main__":
main()


Nesta página do site você pode assistir ao vídeo on-line Python PyQt5 IMAGES are easy! 📷 duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Bro Code 25 Julho 2024, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 13,296 vezes e gostou 216 espectadores. Boa visualização!