Module: Magick::RVG::ImageConstructors

Included in:
Embellishable, Pattern
Defined in:
lib/rvg/embellishable.rb

Overview

Methods that construct raster image objects within a container

Instance Method Summary collapse

Instance Method Details

#image(image, width = nil, height = nil, x = 0, y = 0) ⇒ Object

Composite a raster image at [x,y] in a viewport of the specified width and height. If not specified, the width and height are the width and height of the image. Use the RVG::PreserveAspectRatio#preserve_aspect_ratio method to control the placement and scaling of the image within the viewport. By default, the image is scaled to fit inside the viewport and centered within the viewport.



372
373
374
375
376
# File 'lib/rvg/embellishable.rb', line 372

def image(image, width = nil, height = nil, x = 0, y = 0)
  img = Image.new(image, width, height, x, y)
  @content << img
  img
end