Sha256: e2f0993d0b31bd5229c38039f3488c1a8dfe538cc651b957c7824ce44461c22e

Contents?: true

Size: 774 Bytes

Versions: 59

Compression:

Stored size: 774 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 line01 - lines expressed in user coordinates"

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

    canvas.g.styles(:stroke=>'green') do |grp|
        grp.line(100, 300, 300, 100).styles(:stroke_width=>5)
        grp.line(300, 300, 500, 100).styles(:stroke_width=>10)
        grp.line(500, 300, 700, 100).styles(:stroke_width=>15)
        grp.line(700, 300, 900, 100).styles(:stroke_width=>20)
        grp.line(900, 300, 1100, 100).styles(:stroke_width=>25)
    end

end

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

Version data entries

59 entries across 59 versions & 2 rubygems

Version Path
rmagick-2.13.4 doc/ex/line01.rb
rmagick-2.13.3 doc/ex/line01.rb
rmagick-2.13.3.rc1 doc/ex/line01.rb
rmagick-2.13.2 doc/ex/line01.rb
rdp-rmagick-0.0.0 doc/ex/line01.rb
rmagick-2.13.1 doc/ex/line01.rb
rmagick-2.12.2 doc/ex/line01.rb
rmagick-2.12.1 doc/ex/line01.rb
rmagick-2.12.0 doc/ex/line01.rb
rmagick-2.11.1 doc/ex/line01.rb
rmagick-2.10.0 doc/ex/line01.rb
rmagick-2.11.0 doc/ex/line01.rb
rmagick-1.10.0 doc/ex/line01.rb
rmagick-1.10.1 doc/ex/line01.rb
rmagick-1.11.0 doc/ex/line01.rb
rmagick-1.13.0 doc/ex/line01.rb
rmagick-1.12.0 doc/ex/line01.rb
rmagick-1.11.1 doc/ex/line01.rb
rmagick-1.15.10 doc/ex/line01.rb
rmagick-1.15.1 doc/ex/line01.rb