Sha256: b19274d85f8f302034aab3c45f503ba37f57b1da0e2522e94773a1312adc4a5b

Contents?: true

Size: 604 Bytes

Versions: 67

Compression:

Stored size: 604 Bytes

Contents

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

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

gc = Magick::Draw.new
gc.stroke('blue').stroke_width(3)

# Draw red 5-pointed star
gc.fill('red')
gc.polygon( 75,37.5,     89.5,80.5, 134.5,80.5,   98.5,107.5,
           111.5,150.5,  75,125,    38.5,150.5,   51.5,107.5,
           15.5,80.5,    60.5,80.5)
# Draw green hexagon
gc.fill('lime')
gc.polygon(225,37.5,  279,68.75, 279,131.25,
           225,162.5, 171,131.3, 171,68.75)

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

imgl.write("polygon.gif")

Version data entries

67 entries across 67 versions & 2 rubygems

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