Sha256: 23b455f0cae7393c169864e0ccb3b972067b4dcdf54e61698fe5c65b05f8367d

Contents?: true

Size: 713 Bytes

Versions: 5

Compression:

Stored size: 713 Bytes

Contents

require File.join(File.dirname(__FILE__), 'new_image.rb')

# Taken from RMagick documentation. Modified.

imgl = Magick::Image.new(300, 300, Magick::HatchFill.new('white','lightcyan2'))

gc = Magick::Draw.new

# Move the origin to the center.
gc.translate(125, 125)
max_x = imgl.columns/2
max_y = imgl.rows/2

# Skew y 30 degrees
gc.skewy(30)

# Draw down-pointing arrow
gc.fill('gray50')

gc.line(0, -max_y,   0, max_y)
gc.line(0,  max_y,  10, max_y-10)
gc.line(0,  max_y, -10, max_y-10)

# Draw right-pointing arrow
gc.stroke('red')
gc.stroke_width(3)
gc.line(-max_x+10, 0, max_x-10,   0)
gc.line( max_x-10, 0, max_x-20, -10)
gc.line( max_x-10, 0, max_x-20,  10)

gc.draw(imgl)

imgl.write("draw_skewy_01.jpg")

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rmagick4j-0.4.0-java test/eyetests/tests/draw_skewy_01.rb
rmagick4j-0.3.9-java test/eyetests/tests/draw_skewy_01.rb
rmagick4j-0.3.8 test/eyetests/tests/draw_skewy_01.rb
rmagick4j-0.3.7 test/eyetests/tests/draw_skewy_01.rb
rmagick4j-0.3.6 test/eyetests/tests/draw_skewy_01.rb