Sha256: 32daa14133c4ad7c0780c8432203b7cf1e0f8b670eccde1c0f959dabf0ea390b

Contents?: true

Size: 1.11 KB

Versions: 59

Compression:

Stored size: 1.11 KB

Contents

require 'rvg/rvg'

Magick::RVG.dpi = 90

rvg = Magick::RVG.new(12.cm, 6.cm).viewbox(0, 0, 1200, 600) do |canvas|
    canvas.title = "Example quad01 - quadratic Bezier commands in path data"
    canvas.desc = <<-END_DESC
        Picture showing a "Q" a "T" command, along with annotations showing the
        control points and end points
        END_DESC
    canvas.background_fill = 'white'
    canvas.rect(1195, 592, 1, 1).styles(:fill=>'none', :stroke=>'blue', :stroke_width=>1)

    canvas.path("M200,300 Q400,50 600,300 T1000,300").
                styles(:fill=>'none', :stroke=>'red', :stroke_width=>5)

    # End points
    canvas.g.styles(:fill=>'black') do |grp|
        grp.circle(10, 200, 300)
        grp.circle(10, 600, 300)
        grp.circle(10, 1000, 300)
    end

    # Control points and lines from end points to control points
    canvas.g.styles(:fill=>'#888') do |grp|
        grp.circle(10, 400, 50)
        grp.circle(10, 800, 550)
    end

    canvas.path("M200,300 L400,50 L600,300 L800,550 L1000,300").
                styles(:fill=>'none', :stroke=>'#888', :stroke_width=>2)

end

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

Version data entries

59 entries across 59 versions & 2 rubygems

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