Sha256: 3bac9f37b0888134d223945f110534fc7fdb937d7e4389b51ab31a145345f787

Contents?: true

Size: 615 Bytes

Versions: 13

Compression:

Stored size: 615 Bytes

Contents

require 'rvg/rvg'

Magick::RVG.dpi = 90

rvg = Magick::RVG.new(12.cm, 4.cm).viewbox(0, 0, 1200, 400) do |canvas|
  canvas.background_fill = 'white'
  canvas.desc = 'Example ellipse01 - examples of ellipses'

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

  canvas.g.translate(300, 200) do |grp|
    grp.ellipse(250, 100).styles(:fill=>'red')
  end

  canvas.g.translate(900, 200).rotate(-30) do |grp|
    grp.ellipse(250, 100).styles(:fill=>'none', :stroke=>'blue', :stroke_width=>20)
  end
end

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

Version data entries

13 entries across 13 versions & 3 rubygems

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