Sha256: df595f99a0e55b154d6fcd55f043ce458cc066e2ef924febda6c1da7527a5f64

Contents?: true

Size: 822 Bytes

Versions: 67

Compression:

Stored size: 822 Bytes

Contents

#! /usr/local/bin/ruby -w
require 'RMagick'

# Demonstrate the "path" drawing primitive.

imgl = Magick::ImageList.new
imgl.new_image(450, 200, Magick::HatchFill.new('white','lightcyan2'))

gc = Magick::Draw.new

# Draw "pie chart"
gc.fill('red')
gc.stroke('blue')
gc.stroke_width(2)
gc.path('M110,100 h-75 a75,75 0 1,0 75,-75 z')
gc.fill('yellow')
gc.path('M97.5,87.5 v-75 a75,75 0 0,0 -75,75 z')

# Draw wiggly line
gc.fill_opacity(0)
gc.stroke('#00cd00')
gc.stroke_width(3)
gc.path('M200,175 l 25,-12.5 ' +
                'a12.5,12.5 -15 0,1 25,-12.5 l 25,-12.5 ' +
                'a12.5,25   -15 0,1 25,-12.5 l 25,-12.5 ' +
                'a12.5,37.5 -15 0,1 25,-12.5 l 25,-12.5 ' +
                'a12.5,50   -15 0,1 25,-12.5 l 25,-12.5')

gc.draw imgl
imgl.border!(1,1, "lightcyan2")

imgl.write('arcpath.gif')

Version data entries

67 entries across 67 versions & 2 rubygems

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