Closed kkxlkkxllb closed 12 years ago
replace gem 'dimensions' with 'rmagick'
require 'RMagick'
class Mgick
def initialize(img_path = "public/pics/sky.jpg")
@img=Magick::Image.read(img_path).first
@img_h = @img.rows
@img_w = @img.columns
end
def draw(x,y,text)
gc = Magick::Draw.new
gc.pointsize(22)
gc.fill('white')
gc.stroke('transparent')
gc.text(x,y,text)
gc.draw(@img)
#@img.transparent_color = 'white'
#@img.transparent('white')
@img.write('public/smaple.jpg')
end
end
http://zy13.iteye.com/blog/125487
http://rmagick.rubyforge.org/portfolio2.html
http://rubydoc.info/gems/rmagick/frames