Sha256: 7ece5551fff48d4323f683f2045e9fd4da3c6b9d29c87e798300158d45c3b39a

Contents?: true

Size: 414 Bytes

Versions: 13

Compression:

Stored size: 414 Bytes

Contents

require 'rvg/rvg'

hat = Magick::Image.read('images/Flower_Hat.jpg').first
rvg = Magick::RVG.new(hat.columns, hat.rows) do |canvas|
  keyhole = Magick::RVG::ClipPath.new do |path|
    path.circle(60, canvas.width/2, 80)
    path.polygon(canvas.width/2-10, 60, 40, 230, 160, 230, canvas.width/2+10, 60)
  end
  canvas.image(hat, nil, nil, 20, 20).styles(:clip_path=>keyhole)
end

rvg.draw.write('rvg_clippath.gif')

Version data entries

13 entries across 13 versions & 3 rubygems

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