PNMPainter¶
-
class PNMPainter¶
This class provides a number of convenient methods for painting drawings directly into a
PNMImage.It stores a pointer to the
PNMImageyou pass it, but it does not take ownership of the object; you are responsible for ensuring that thePNMImagedoes not destruct during the lifetime of the PNMPainter object.Inheritance diagram
digraph inheritance75a06084c7 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "PNMPainter" [URL="acron.core.PNMPainter.html#acron.core.PNMPainter",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "PNMPainter" [arrowsize=0.75,style=""]; }- PNMPainter.__init__()¶
The constructor stores a pointer to the
PNMImageyou pass it, but it does not take ownership of the object; you are responsible for ensuring that thePNMImagedoes not destruct during the lifetime of thePNMPainterobject.The xo, yo coordinates specify an optional offset for fill coordinates. If you are painting with a pattern fill, these specify the virtual coordinates of the upper-left corner of the image, which can allow you to adjust the pattern to line up with nested images, if necessary.
- PNMPainter.draw_rectangle()¶
Draws a filled rectangule on the
PNMImage, using the current pen for the outline, and the current fill brush for the interior.The two coordinates specify any two diagonally opposite corners.
- PNMPainter.get_fill()¶
Returns the current fill brush. See
set_fill().
- PNMPainter.get_pen()¶
Returns the current pen. See
set_pen().
- PNMPainter.set_fill()¶
Specifies a
PNMBrushthat will be used for filling in the interiors of objects. If the brush is a bitmap brush, its image will be tiled throughout the space.Unlike the
PNMImagepassed to the constructor, thePNMPainterwill take ownership of the fill brush. It is not necessary to keep a separate pointer to it.
- PNMPainter.set_pen()¶
Specifies a
PNMBrushthat will be used for drawing lines and edges. If the brush is a bitmap brush, its image will be smeared pixelwise along the line.Unlike the
PNMImagepassed to the constructor, thePNMPainterwill take ownership of the pen. It is not necessary to keep a separate pointer to it.