# painting

From qtpaint v1.1.0
by Michael Lawrence

##### Drawing API

These functions constitute the primary drawing API. There is support for drawing points, polylines, segments, circles, rectangles, polygons, vector paths, text, images and plot glyphs.

##### Usage

```
qdrawLine(p, x, y, stroke)
qdrawSegment(p, x0, y0, x1, y1, stroke)
qdrawPoint(p, x, y, stroke)
qdrawRect(p, xleft, ybottom, xright, ytop, stroke, fill)
qdrawCircle(p, x, y, r, stroke, fill)
qdrawPolygon(p, x, y, stroke, fill)
qdrawPath(p, path, stroke, fill)
qdrawText(p, text, x, y, halign=c("center", "left", "right"), valign=c("center",
"basecenter", "baseline", "bottom", "top"), rot=0, color, cex=1,
hcex=cex, vcex=cex)
qdrawImage(p, image, x, y)
qdrawGlyph(p, path, x, y, cex, stroke, fill)
```

##### Arguments

- p
- The paint context
- x
- The X coordinate vector, recycled. For polygons and polylines, NA values separate the graphical primitives.
- y
- The Y coordinate vector, recycled. For polygons and polylines, NA values separate the graphical primitives.
- stroke
- The vector of stroke colors, either a C++
`QColor`

object, a matrix returned by`col2rgb`

or any valid input to`col2rgb`

, recycled - x0
- The vector of first X coordinates, recycled
- y0
- The vector of first Y coordinates, recycled
- x1
- The vector of second X coordinates, recycled
- y1
- The vector of second Y coordinates, recycled
- fill
- The vector of fill colors, either a C++
`QColor`

object, a matrix returned by`col2rgb`

or any valid input to`col2rgb`

, recycled - xleft
- The vector of left X coordinates for a rectangle, recycled
- ybottom
- The vector of bottom Y coordinates for a rectangle, recycled
- xright
- The vector of right X coordinates for a rectangle, recycled
- ytop
- The vector of top Y coordinates for a rectangle, recycled
- r
- The radius of the circle, in device coordinates, recycled
- path
- A C++
`QPainterPath`

object describing the glyph, or a list of such objects for`qdrawPath`

. - text
- The vector of strings to draw, recycled
- halign
- The side of the text to horizontally align to the coordinate
- valign
- The side of the text to vertically align to the coordinate. Besides the obvious alignment options, there are two different ways to center the text: according to the entire text extents ("center") or only according to the region above the baseline ("basecenter"). The former may be better for plotting text, while the latter may be better for labeling.
- rot
- The vector of the text rotations, in degrees, recycled
- color
- The stroke color of the text
- cex
- The vector of numeric expansion factors of the glyphs, recycled
- hcex
- The vector of numeric horizontal expansion factors of
the glyphs, recycled. Overrides the
`cex`

in the horizontal direction. - vcex
- The vector of numeric vertical expansion factors of
the glyphs, recycled. Overrides the
`cex`

in the vertical direction. - image
- A C++
`QImage`

object

*Documentation reproduced from package qtpaint, version 1.1.0, License: GPL version 2 or later*

### Community examples

Looks like there are no examples yet.