Sha256: 1f5d736243c5981a165a778e9a2f3ba460c8824d1bc51d55f57d873c5b8dd883

Contents?: true

Size: 596 Bytes

Versions: 13

Compression:

Stored size: 596 Bytes

Contents

#!/usr/bin/env ruby -w

require 'rmagick'

hat = Magick::Image.read('images/Flower_Hat.jpg').first
hat.resize!(0.25)

# Construct a pattern using the hat image
gc = Magick::Draw.new
gc.pattern('hat', 0, 0, hat.columns, hat.rows) do
  gc.composite(0, 0, 0, 0, hat)
end

# Set the fill to the hat "pattern." Draw an ellipse
gc.fill('hat')
gc.ellipse(150, 75, 140, 70, 0, 360)

# Create a canvas to draw on
img = Magick::Image.new(300, 150, Magick::HatchFill.new('white','lightcyan2',8))

# Draw the ellipse using the fill
gc.draw(img)

img.border!(1,1, 'lightcyan2')
img.write('pattern2.gif')
exit

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
rmagick-windows-2.16.5 doc/ex/pattern2.rb
rmagick-windows-2.16.4 doc/ex/pattern2.rb
rmagick-windows-2.16.3 doc/ex/pattern2.rb
rmagick-windows-2.16.2 doc/ex/pattern2.rb
rmagick-windows-2.16.1 doc/ex/pattern2.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/rmagick-2.16.0/doc/ex/pattern2.rb
rmagick-2.16.0 doc/ex/pattern2.rb
rmagick-2.15.4 doc/ex/pattern2.rb
rmagick-2.15.3 doc/ex/pattern2.rb
rmagick-2.15.2 doc/ex/pattern2.rb
rmagick-2.15.1 doc/ex/pattern2.rb
rmagick-2.15.0 doc/ex/pattern2.rb
rmagick-2.14.0 doc/ex/pattern2.rb