Module: Magick::RVG::ShapeConstructors

### Home Classes Methods

### In Files

- lib/rvg/embellishable.rb

### Methods

- #circle
- #ellipse
- #line
- #path
- #polygon
- #polyline
- #rect

### Files

- Makefile

### Class/Module Index

Quicksearch

- Magick
- Magick::DestroyedImageError
- Magick::Draw
- Magick::Enum
- Magick::FatalImageMagickError
- Magick::Geometry
- Magick::GeometryValue
- Magick::GradientFill
- Magick::HatchFill
- Magick::IPTC
- Magick::IPTC::Application
- Magick::IPTC::Envelope
- Magick::IPTC::ObjectData
- Magick::IPTC::Post_ObjectData_Descriptor
- Magick::IPTC::Pre_ObjectData_Descriptor
- Magick::Image
- Magick::Image::DrawOptions
- Magick::Image::Info
- Magick::Image::PolaroidOptions
- Magick::Image::View
- Magick::Image::View::Pixels
- Magick::Image::View::Rows
- Magick::ImageList
- Magick::ImageList::Montage
- Magick::ImageMagickError
- Magick::OptionalMethodArguments
- Magick::Pixel
- Magick::RVG
- Magick::RVG::Circle
- Magick::RVG::ClipPath
- Magick::RVG::Describable
- Magick::RVG::Duplicatable
- Magick::RVG::Ellipse
- Magick::RVG::Embellishable
- Magick::RVG::Group
- Magick::RVG::Image
- Magick::RVG::ImageConstructors
- Magick::RVG::Line
- Magick::RVG::Path
- Magick::RVG::PathData
- Magick::RVG::Pattern
- Magick::RVG::PolyShape
- Magick::RVG::Polygon
- Magick::RVG::Polyline
- Magick::RVG::PreserveAspectRatio
- Magick::RVG::Rect
- Magick::RVG::ShapeConstructors
- Magick::RVG::Stretchable
- Magick::RVG::StructureConstructors
- Magick::RVG::Stylable
- Magick::RVG::Text
- Magick::RVG::TextBase
- Magick::RVG::TextConstructors
- Magick::RVG::Transformable
- Magick::RVG::Use
- Magick::RVG::UseConstructors
- Magick::RVG::Utility
- Magick::RVG::Utility::DefaultTextStrategy
- Magick::RVG::Utility::GraphicContext
- Magick::RVG::Utility::LRTextStrategy
- Magick::RVG::Utility::RLTextStrategy
- Magick::RVG::Utility::TBTextStrategy
- Magick::RVG::Utility::TextAttributes
- Magick::RVG::Utility::TextStrategy
- Magick::SolidFill
- Magick::TextureFill
- Object

No matching classes.

# Magick::RVG::ShapeConstructors

Methods that construct basic shapes within a container

### Public Instance Methods

circle(r, cx=0, cy=0) click to toggle source

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

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

ellipse(rx, ry, cx=0, cy=0) click to toggle source

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

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

line(x1=0, y1=0, x2=0, y2=0) click to toggle source

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

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

path(path) click to toggle source

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

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

polygon(*points) click to toggle source

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.

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

polyline(*points) click to toggle source

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.

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

rect(width, height, x=0, y=0) click to toggle source

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`.

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.