Sha256: edf120bf182cf631b79a5c4b87caa2f09c7f9fcd77abbe87b5d25452d71ede8d

Contents?: true

Size: 936 Bytes

Versions: 13

Compression:

Stored size: 936 Bytes

Contents

#!/usr/bin/env 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

13 entries across 13 versions & 3 rubygems

Version Path
rmagick-windows-2.16.5 doc/ex/stroke_dasharray.rb
rmagick-windows-2.16.4 doc/ex/stroke_dasharray.rb
rmagick-windows-2.16.3 doc/ex/stroke_dasharray.rb
rmagick-windows-2.16.2 doc/ex/stroke_dasharray.rb
rmagick-windows-2.16.1 doc/ex/stroke_dasharray.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/rmagick-2.16.0/doc/ex/stroke_dasharray.rb
rmagick-2.16.0 doc/ex/stroke_dasharray.rb
rmagick-2.15.4 doc/ex/stroke_dasharray.rb
rmagick-2.15.3 doc/ex/stroke_dasharray.rb
rmagick-2.15.2 doc/ex/stroke_dasharray.rb
rmagick-2.15.1 doc/ex/stroke_dasharray.rb
rmagick-2.15.0 doc/ex/stroke_dasharray.rb
rmagick-2.14.0 doc/ex/stroke_dasharray.rb