Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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))
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 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)