O'Reilly logo

Python 2.6 Graphics Cookbook by Mike Ohlson de Fine

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Drawing Fundamental Shapes

In this chapter, we will cover:

  • A straight line and the coordinate system
  • Drawing a dashed line
  • Lines of varying styles with arrows and endcaps
  • A two-segment line with a sharp bend
  • A line with a curved bend
  • Drawing intricate stored shapes - the curly vine
  • Drawing a rectangle
  • Drawing overlapping rectangles
  • Drawing concentric squares
  • A circle from an oval
  • A circle from an arc
  • Three ellipses
  • The simplest polygon
  • A star polygon
  • The art of cloning stars

Introduction

Graphics are all about pictures and drawings. In computer programs, a line is not drawn by a hand, holding a pencil, but by the manipulation of numbers on a screen. This chapter provides the fine-grained detail or atomic structure for the rest of the book. Here we lay ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required