Sha256: dab227ec8116b3057559a57ebc8b148d4f40e5a686cde8abd3a83b836d7e64f0

Contents?: true

Size: 864 Bytes

Versions: 52

Compression:

Stored size: 864 Bytes

Contents

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

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

# Draw Bezier curve
gc.stroke('red')
gc.stroke_width(3)
gc.fill_opacity(0)
gc.bezier(25,125, 100,25, 400,25, 325,125)

# Draw circles around end points
gc.fill_opacity(0)
gc.stroke('gray50').stroke_width(1)
gc.circle(25,125, 28, 128)
gc.circle(325,125, 328, 123)

# Draw filled circles around control points
gc.line(25,125, 100,25)
gc.line(325,125, 400,25)
gc.fill_opacity(1)
gc.fill('gray50')
gc.circle(100,25, 103,28)
gc.circle(400,25, 403,28)

# Annotate
gc.fill('black')
gc.stroke('transparent')
gc.text(34,125, "'25,125'")
gc.text(107,25, "'100,25'")
gc.text(335,125, "'325,125'")
gc.text(405,25, "'400,25'")

gc.draw(imgl)
imgl.border!(1,1, "lightcyan2")
imgl.write('cbezier2.gif')
exit(0)

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
rmagick-1.10.0 doc/ex/cbezier2.rb
rmagick-1.10.1 doc/ex/cbezier2.rb
rmagick-1.12.0 doc/ex/cbezier2.rb
rmagick-1.11.1 doc/ex/cbezier2.rb
rmagick-1.11.0 doc/ex/cbezier2.rb
rmagick-1.13.0 doc/ex/cbezier2.rb
rmagick-1.15.10 doc/ex/cbezier2.rb
rmagick-1.15.0 doc/ex/cbezier2.rb
rmagick-1.14.0 doc/ex/cbezier2.rb
rmagick-1.15.1 doc/ex/cbezier2.rb
rmagick-1.14.1 doc/ex/cbezier2.rb
rmagick-1.15.12 doc/ex/cbezier2.rb
rmagick-1.15.11 doc/ex/cbezier2.rb
rmagick-1.15.13 doc/ex/cbezier2.rb
rmagick-1.15.15 doc/ex/cbezier2.rb
rmagick-1.15.14 doc/ex/cbezier2.rb
rmagick-1.15.2 doc/ex/cbezier2.rb
rmagick-1.15.17 doc/ex/cbezier2.rb
rmagick-1.15.16 doc/ex/cbezier2.rb
rmagick-1.15.3 doc/ex/cbezier2.rb