Sha256: 4bbc1d4915293ba14487e98872d6e4bd654830d038a7c16c46bbdbb68d1504b0
Contents?: true
Size: 699 Bytes
Versions: 5
Compression:
Stored size: 699 Bytes
Contents
require File.join(File.dirname(__FILE__), 'new_image.rb') # Taken from RMagick documentation. Modified. imgl = Magick::Image.new(200, 200, Magick::HatchFill.new('white','lightcyan2')) gc = Magick::Draw.new # Move the origin to the center. gc.translate(100, 100) max_x = imgl.columns/2 max_y = imgl.rows/2 # Scale by 0.5 and 1/3. gc.scale(0.5, 1.0/3.0) gc.stroke('red') gc.stroke_width(3) # Draw down-pointing arrow 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.line(-max_x, 0, max_x, 0) gc.line( max_x, 0, max_x-10, -10) gc.line( max_x, 0, max_x-10, 10) gc.draw(imgl) imgl.write("draw_scale_01.jpg")
Version data entries
5 entries across 5 versions & 1 rubygems