- Add code to this method to write your name in blue on the bottom of the picture:
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
- Given a QPainter object called painter, write a line of code to paint an 80 × 80 pixel octagon in the upper-left corner of the painter...