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.7.0 doc/ex/polygon.rb
rmagick-2.7.1 doc/ex/polygon.rb
rmagick-2.7.2 doc/ex/polygon.rb
rmagick-2.8.0 doc/ex/polygon.rb
rmagick-2.9.1 doc/ex/polygon.rb
rmagick-2.9.0 doc/ex/polygon.rb
rmagick-2.9.2 doc/ex/polygon.rb