added a clipping example
[PyX/mjg.git] / examples / drawing2 / clipping.txt
blob3374cafffaf1a913f6334d7d784297f28b9e8541
1 Clipping a canvas
3 This example shows how drawing on a canvas can be clipped to a predefined
4 region. The thick line is drawn two times, first in black onto an ordinary
5 canvas, the second time in red onto a canvas which is clipped to the indicated
6 circle. ...
8 The clipping property of a canvas must be specified on creation with an
9 instance of `canvas.clip`, which takes a path as an argument.
11 ! The clipped canvas `cl` is additionally equipped with the argument
12 `color.rgb.red`, which is then the default color of the canvas. If no other
13 color ist specified while drawing, all drawing is performed with this color.