rmagick gem install on intel mac
sudo env ARCHFLAGS="-arch i386" gem install rmagick
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
#!/usr/bin/env ruby -wKU # Test if rmagick is working properly or not. # When run, this file creates a image file 'path.gif' in the same directory. # the sample code is from http://rmagick.rubyforge.org/portfolio3.html require 'rubygems' require 'rmagick' # Don't use a capital 'R'. canvas = Magick::Image.new(240, 300, Magick::HatchFill.new('white','lightcyan2')) gc = Magick::Draw.new gc.fill('red') gc.stroke('blue') gc.stroke_width(2) gc.path('M120,150 h-75 a75,75 0 1, 0 75,-75 z') gc.fill('yellow') gc.path('M108.5,138.5 v-75 a75,75 0 0,0 -75,75 z') gc.draw(canvas) canvas.write('path.gif')