def repaint(self, event: Event): # Draw something on the image ctx = DrawingContext(self.image) ctx.fill('#') text = "1234567890" for i in range(min(self.image.size.width, self.image.size.height)): ctx.fill(text[i % len(text)]) ctx.clip_by(1, 1, -1, -1)
def repaint(self, event: Event): # Draw something on the image ctx = DrawingContext(self.image) ctx.fill('.') title = "TextLand Demo Application" ctx.move_to((self.image.size.width - len(title)) // 2, 0) ctx.print(title) ctx.print('=' * len(title)) ctx.move_to(0, 3) ctx.print("Type 'q' to quit") ctx.move_to(10, 10) ctx.print("Event: {}".format(event))
def repaint(self, event: Event): # Draw something on the image ctx = DrawingContext(self.image) ctx.fill(' ') for y in range(self.image.size.height): ctx.move_to(0, y) if y % 10 == 0: ctx.print('---') if y > 0: ctx.move_to(4, y) ctx.print("{:-2d}".format(y)) else: ctx.print('-') text = "TextLand Ruler" ctx.move_to((self.image.size.width - len(text)) // 2, self.image.size.height // 2) ctx.print(text)
def repaint(self, event: Event): # Draw something on the image ctx = DrawingContext(self.image) ctx.fill(' ') for y in range(self.image.size.height): ctx.move_to(0, y) if y % 10 == 0: ctx.print('---') if y > 0: ctx.move_to(4, y) ctx.print("{:-2d}".format(y)) else: ctx.print('-') text = "TextLand Ruler" ctx.move_to( (self.image.size.width - len(text)) // 2, self.image.size.height // 2) ctx.print(text)