class RVG::Image <
Table of Contents
In addition to the methods listed above,
RVG::Image also implements the styles method and the transform methods.
height=nil, x=0, y=0) ->
Constructs a raster image object. The viewbox is defined by
the image bounds. This method is usually called indirectly via
image method in the RVG, RVG::Group, or RVG::Pattern classes.
- A Magick::Image
- width, height
- The width and height of the rectangle in which the image
- x, y
- The x- and y-axis location of the
rectangle in which the image is placed.
image.desc -> aString
image.desc = aString
desc attribute to
assign a text description to the image.
image.metadata -> aString
image.metadata = aString
metadata attribute to
assign additional metadata to the image.
image.title -> aString
image.title = aString
title attribute to
assign a title to the image.
image.preserve_aspect_ratio(align, meet_or_slice='meet') -> self
preserve_aspect_ratio to specify whether or
not the image is stretched to fit the rectangle in which it is
placed. If not, you can specify how to fit the image into the
When the value of the
is 'meet' or 'slice', this argument controls the placement
of the image within the viewport. The
argument is the concatenation of an x-aligment and
a y-alignment. The values are shown in these
- align the minimum x value of the image with
the left corner of the viewport.
- vertically center the image within the viewport.
- align the maximum x value of the image with
the right corner of the viewport.
- align the minimum y value of the image with
the top of the viewport.
- horizontally center the image within the
- align the maximum y value of the image with
the bottom of the viewport
This argument can have one of these three values:
- The image is scaled as necessary so that it fits
exactly within the viewport. The aspect ratio is
- The image is scaled as necessary so that the larger
dimension exactly fits the viewport. There may be some
unused space in the viewport. The aspect ratio is
- The image is scaled as necessary so that the smaller
dimension exactly fits the viewport. Some of the image in
the larger dimension may be cut off. The aspect ratio is