且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Ruby / Rails图像处理库

更新时间:2023-11-25 16:08:04

我写了如下内容:

require 'rubygems'
require 'RMagick'
include Magick

image = Image.new(50, 50) {
  self.background_color = "white"
}
text = Draw.new
text.annotate(image, 0,0,0,40, 'Named Colors') {
     self.fill = 'black'
     self.pointsize = 32
}
image.write("image.png")

哪个应该是很容易遵循。另请参阅文档。虽然它并不完美,但它几乎都在那里。

Which should be easy enough to follow. Also have a look at the documentation. Whilst it's not quite laid out to perfection, it's pretty much all there.