Sha256: 6c72dc80ffd8824c4ef80547880b84cb732d68a43a883b30aa5f23a46b90565d

Contents?: true

Size: 607 Bytes

Versions: 13

Compression:

Stored size: 607 Bytes

Contents

require 'rvg/rvg'

Magick::RVG.dpi = 90

rvg = Magick::RVG.new(12.cm, 4.cm) do |canvas|
  canvas.viewbox(0, 0, 1200, 400)
  canvas.background_fill = 'white'
  canvas.desc = 'Example rect02 - rounded rectangles'

  # Show outline of canvas using 'rect' method
  canvas.rect(1195, 395, 1, 1).styles(:fill=>'none', :stroke=>'blue', :stroke_width=>2)

  canvas.rect(400, 200, 100, 100).round(50).styles(:fill=>'green')

  canvas.g.translate(700, 210).rotate(-30) do |grp|
    grp.rect(400, 200, 0, 0).round(50).styles(:fill=>'none', :stroke=>'purple', :stroke_width=>30)
  end
end

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

Version data entries

13 entries across 13 versions & 3 rubygems

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