Advertisement
here2share

# pieslice_demo.py

Jan 9th, 2015
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # pieslice_demo.py
  2.  
  3. import appuifw, e32, graphics
  4. import math
  5.  
  6. def draw(rect):
  7.     try: canvas.blit(img)
  8.     except: pass
  9.  
  10. def quit():
  11.     script_lock.signal()
  12.  
  13. canvas = appuifw.Canvas(redraw_callback=draw)
  14. appuifw.app.directional_pad=False
  15. appuifw.app.orientation='portrait'
  16. appuifw.app.screen='large'
  17. appuifw.app.body=canvas
  18. w,h = canvas.size
  19. img=graphics.Image.new((w,h))
  20.  
  21. img.clear((255,255,255))
  22.  
  23. appuifw.app.exit_key_handler = quit
  24.  
  25. img.pieslice(((20,50), (320,350)), 0, math.pi/2,
  26.             width=2, outline=(255,0,0), fill=(255,255,0))
  27.  
  28. img.pieslice(((50,300), (320,500)), math.pi/2, math.pi/4,
  29.             fill=(0,0,255))
  30. draw(())
  31.  
  32. lock = e32.Ao_lock()
  33. appuifw.app.exit_key_handler = lambda:lock.signal()
  34. lock.wait()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement