Sha256: 14e4325882b7509d64513e03cf946db9a1735e9d134899483d125b8d5767d7d2

Contents?: true

Size: 627 Bytes

Versions: 6

Compression:

Stored size: 627 Bytes

Contents

#!/usr/bin/env ruby -w
require 'rmagick'

imgl = Magick::ImageList.new
imgl.new_image(300, 100, Magick::HatchFill.new('white', 'lightcyan2'))

points = [12, 93.75,   37, 93.75,  37, 81.25, 62, 81.25,
          62, 93.75,   87, 93.75,  87, 62,    112, 62, 112, 93.75,
          137, 93.75, 137, 43.75, 162, 43.75, 162, 93.75,
          187, 93.75, 187, 25,    212, 25,    212, 93.75, 237, 93.75,
          237, 6.25,  262, 6.25,  262, 93.75, 287, 93.75]

gc = Magick::Draw.new
gc.stroke('blue').stroke_width(3)
gc.fill_opacity(0)
gc.polyline(*points)

gc.draw(imgl)

imgl.border!(1, 1, 'lightcyan2')

imgl.write('polyline.gif')

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rmagick-4.1.0.rc2 doc/ex/polyline.rb
rmagick-4.1.0.rc1 doc/ex/polyline.rb
rmagick-4.0.0 doc/ex/polyline.rb
rmagick-3.2.0 doc/ex/polyline.rb
rmagick-3.1.0 doc/ex/polyline.rb
rmagick-3.0.0 doc/ex/polyline.rb