Method: Magick::Draw#pattern

Defined in:
lib/rmagick_internal.rb

#pattern(name, x, y, width, height) ⇒ Object

Define a pattern. In the block, call primitive methods to draw the pattern. Reference the pattern by using its name as the argument to the ‘fill’ or ‘stroke’ methods



464
465
466
467
468
469
470
471
472
473
# File 'lib/rmagick_internal.rb', line 464

def pattern(name, x, y, width, height)
  push('defs')
  push("pattern #{name} " + sprintf('%g %g %g %g', x, y, width, height))
  push('graphic-context')
  yield
ensure
  pop('graphic-context')
  pop('pattern')
  pop('defs')
end