Easy Draw Module
  • About the Project
  • Student Developed Art
  • 🐍Python
    • Setup and Install
    • Starter Template
    • Example Code
    • Style Guide
    • Module Reference
      • The Drawing Canvas
      • Colors
      • Drawing Shapes
      • Text and Images
      • Property Getting and Setting
      • Object Methods
      • Event Handling
      • Saving Your Drawing
    • Power Users
    • Issues and Features Coming Soon...
  • Python Curriculum
    • Unit 1: Drawing Basics
    • Unit 2: Drawing Algorithms
    • Unit 3: Functions and Events
  • ☕Java
  • Coming Soon...
  • Java Curriculum
    • Unit 1: Using Easy Draw Objects
    • Unit 2: If Statements and Drawings
    • Unit 3: Iteration and Drawings
    • Unit 4: Methods and Classes to Abstract Drawings
    • Tabs
Powered by GitBook
On this page
  • Loading the Canvas
  • Changing the Background Color
  • Ending the Program

Was this helpful?

Export as PDF
  1. Python
  2. Module Reference

The Drawing Canvas

PreviousModule ReferenceNextColors

Last updated 4 years ago

Was this helpful?

All shapes will be drawn on a canvas.

The Easy Draw canvas is 600 x 600 pixels (600 pixels wide by 600 pixels tall). So (300, 300) is the middle of the canvas, and (600, 600) is the bottom-right corner.

The coordinate system origin (0, 0) is the top-left corner of the canvas.

As x increases, objects move right. As y increases, objects move down (not up!).

Loading the Canvas

load_canvas()

Load canvas has one optional argument - background. The background property allows you to identify a color value for the canvas on load.

Example:

easy_draw.load_canvas(background = (255, 0, 0))

Changing the Background Color

set_canvas_color(color)

Used to change the canvas background color at any point in the program.

Example:

easy_draw.set_canvas_color(color = (0, 0, 255))

Ending the Program

end()

Every Easy Draw program must end with this function call. It sets up the event loop and allows the window to remain open on the desktop.

easy_draw.end()
🐍