#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()
On this page of the site you can watch the video online Python PyQt5 IMAGES are easy! 📷 with a duration of hours minute second in good quality, which was uploaded by the user Bro Code 25 July 2024, share the link with friends and acquaintances, this video has already been watched 13,296 times on youtube and it was liked by 216 viewers. Enjoy your viewing!