Sha256: 9017d610aedad8f0fabf16c8f8d2cdeac92bf2f393f2956eca6380956b543a61

Contents?: true

Size: 940 Bytes

Versions: 15

Compression:

Stored size: 940 Bytes

Contents

#! /usr/local/bin/ruby -w

require 'RMagick'

imgl = Magick::ImageList.new
imgl.new_image(500,180, Magick::HatchFill.new('white','lightcyan2'))
gc = Magick::Draw.new

gc.stroke_width(5)
gc.fill('transparent')

gc.stroke_dasharray(30,10, 10,10)
gc.stroke('green')
gc.line(10, 20, 490, 20)

gc.stroke_dasharray(5,10,5)
gc.stroke_dashoffset(10)
gc.stroke('blue')
gc.line(10, 80, 490, 80)

gc.stroke_dasharray(10,10)
gc.stroke_dashoffset(0)
gc.stroke('red')
gc.line(10, 140, 490, 140)

gc.fill('black')
gc.stroke('transparent')
gc.font_weight(Magick::NormalWeight)
gc.font_style(Magick::NormalStyle)

gc.gravity(Magick::CenterGravity)
gc.text( 0, -60, "'gc.stroke_dasharray(30, 10, 10, 10)'")
gc.text( 0,   0, "'gc.stroke_dasharray(5, 10, 5)'")
gc.text( 0,  12, "'gc.stroke_dashoffset(10)'")
gc.text( 0,  60, "'gc.stroke_dasharray(10, 10)'")

gc.draw(imgl)

imgl.border!(1,1,"lightcyan2")
#imgl.display
imgl.write("stroke_dasharray.gif")
exit

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
rmagick-2.13.4 doc/ex/stroke_dasharray.rb
rmagick-2.13.3 doc/ex/stroke_dasharray.rb
rmagick-2.13.3.rc1 doc/ex/stroke_dasharray.rb
rmagick-2.13.2 doc/ex/stroke_dasharray.rb
rdp-rmagick-0.0.0 doc/ex/stroke_dasharray.rb
rmagick-2.13.1 doc/ex/stroke_dasharray.rb
rmagick-2.12.2 doc/ex/stroke_dasharray.rb
rmagick-2.12.1 doc/ex/stroke_dasharray.rb
rmagick-2.12.0 doc/ex/stroke_dasharray.rb
rmagick-2.11.1 doc/ex/stroke_dasharray.rb
rmagick-2.10.0 doc/ex/stroke_dasharray.rb
rmagick-2.11.0 doc/ex/stroke_dasharray.rb
rmagick-2.9.0 doc/ex/stroke_dasharray.rb
rmagick-2.9.1 doc/ex/stroke_dasharray.rb
rmagick-2.9.2 doc/ex/stroke_dasharray.rb