Ruby On Rails in UA Icon_home Главная Add to bookmarks Translate translate Profile Войти
Регистрация Форум Блоги Пользователи Ресурсы Список джемов      Поиск   

Ruby On Rails in UA/Вопросы по программированию на ROR/Ruby CGI и Watermark/RE: Ruby CGI и Watermark

2008-06-10 05:48:27 Ответить  
Dracula
Dracula
Адрес:
Сообщений: 23
Регистр: 2008-05-31
его блог 0 сообщ.
RE: Ruby CGI и Watermark
  •  
Ruby/GD (formerly known as "GD") is an extension library to use the gd library from Ruby.
http://rubyforge.org/projects/ruby-gd/

Alternative Ruby/GD2
ftp://ftp.mars.org/pub/ruby/ruby-gd2-0.1.tar.gz

Пример:
include GD2
image = File.open('image.png') { |f| Image.load(f) }
image.resize! 200, 300
image.draw do |pen|
pen.color = image.palette.find! Color.new(1.0, 0.75, 0.5)
pen.thickness = 2
pen.move_to 25, 50
pen.line_to 175, 50
pen.move -150, 25
pen.font = Font::TrueType.new('/usr/share/fonts/times.ttf', 20)
pen.text 'Hello, world!'
end
File.open('new-image.png', 'w') { |f| f.write(image.png_data) }
, ,
Назадназад Новыйновый Ответитьответить
Ключевые слова:
Гости: 71 Онлайн: 0
Rambler's Top100
О проекте по всем вопросам обращайтесь на support
Rubyclub.com.ua Copyright © 2007 - 2008