Getting Started« | UserGuide | Coordinate System » EzGraphics provides easy to use tools for creating and working with simple graphical drawings. Geometric shapes and text are drawn on a canvas that is contained within a top-level or desktop window known as a graphics window. Creating a graphical drawing using EzGraphics requires six steps:
Program: sample.py
## sample.py # A simple program that illustrates the use of EzGraphics. # from ezgraphics import GraphicsWindow win = GraphicsWindow() win.setTitle("My First Drawing") canvas = win.canvas() canvas.drawRectangle(40, 40, 100, 200) canvas.drawRectangle(200, 200, 150, 50) win.wait()
|
|||
Last modified: January 28, 2016, at 07:16 PM.
|