#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()
En esta página del sitio puede ver el video en línea Python PyQt5 IMAGES are easy! 📷 de Duración hora minuto segunda en buena calidad , que subió el usuario Bro Code 25 julio 2024, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 13,296 veces y le gustó 216 a los espectadores. Disfruta viendo!