May 2019
Intermediate to advanced
542 pages
13h 37m
English
def create_headshot(self, image_file, name): image = qtg.QImage() image.load(image_file) # your code here # end of your code return image
Your code will need to create QPainter and QPen, then write to the image:
def create_headshot(self, image_file, name): image = qtg.QImage() image.load(image_file) # your code here painter = qtg.QPainter(image) pen = qtg.QPen(qtg.QColor('blue')) painter.setPen(pen) painter.drawText(image.rect(), qtc.Qt.AlignBottom, name) # end of your code return image
Read now
Unlock full access