Module Magick::RVG::ShapeConstructors
In: lib/rvg/embellishable.rb
Enum GeometryValue Stylable RVG\n[lib/rvg/clippath.rb\nlib/rvg/container.rb\nlib/rvg/deep_equal.rb\nlib/rvg/describable.rb\nlib/rvg/embellishable.rb\nlib/rvg/misc.rb\nlib/rvg/paint.rb\nlib/rvg/pathdata.rb\nlib/rvg/rvg.rb\nlib/rvg/stretchable.rb\nlib/rvg/stylable.rb\nlib/rvg/text.rb\nlib/rvg/transformable.rb\nlib/rvg/units.rb] Transformable Stretchable Embellishable Describable Duplicatable Comparable Image ImageList Array Geometry HatchFill Draw lib/RMagick.rb lib/rvg/units.rb Magick Module: Magick

Methods that construct basic shapes within a container

Methods

circle   ellipse   line   path   polygon   polyline   rect  

Public Instance methods

Draws a circle whose center is [cx, cy] and radius is r.

[Source]

     # File lib/rvg/embellishable.rb, line 263
263:         def circle(r, cx=0, cy=0)
264:             circle = Circle.new(r, cx, cy)
265:             @content << circle
266:             return circle
267:         end

Draws an ellipse whose center is [cx, cy] and having a horizontal radius rx and vertical radius ry.

[Source]

     # File lib/rvg/embellishable.rb, line 271
271:         def ellipse(rx, ry, cx=0, cy=0)
272:             ellipse = Ellipse.new(rx, ry, cx, cy)
273:             @content << ellipse
274:             return ellipse
275:         end

Draws a line from [x1, y1] to [x2, y2].

[Source]

     # File lib/rvg/embellishable.rb, line 278
278:         def line(x1=0, y1=0, x2=0, y2=0)
279:             line = Line.new(x1, y1, x2, y2)
280:             @content << line
281:             return line
282:         end

Draws a path defined by an SVG path string or a PathData object.

[Source]

     # File lib/rvg/embellishable.rb, line 286
286:         def path(path)
287:             path = Path.new(path)
288:             @content << path
289:             return path
290:         end

Draws a polygon. The arguments are [x, y] pairs that define the points that make up the polygon. At least two points must be specified. If the last point is not the same as the first, adds an additional point to close the polygon.

[Source]

     # File lib/rvg/embellishable.rb, line 313
313:         def polygon(*points)
314:             polygon = Polygon.new(*points)
315:             @content << polygon
316:             return polygon
317:         end

Draws a polyline. The arguments are [x, y] pairs that define the points that make up the polyline. At least two points must be specified.

[Source]

     # File lib/rvg/embellishable.rb, line 322
322:         def polyline(*points)
323:             polyline = Polyline.new(*points)
324:             @content << polyline
325:             return polyline
326:         end

Draws a rectangle whose upper-left corner is [x, y] and with the specified width and height. Unless otherwise specified the rectangle has square corners. Returns a Rectangle object.

Draw a rectangle with rounded corners by calling the round method on the Rectangle object. rx and ry are the corner radii in the x- and y-directions. For example:

  canvas.rect(width, height, x, y).round(8, 6)

If ry is omitted it defaults to rx.

[Source]

     # File lib/rvg/embellishable.rb, line 302
302:         def rect(width, height, x=0, y=0)
303:             rect = Rect.new(width, height, x, y)
304:             @content << rect
305:             return rect
306:         end

[Validate]