[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

dynamic text as gif

Florian Weber

10/4/2004 9:03:00 AM

hi!

does anybody of you know of a lib which generates a gif or a png
out of a dynamic text and lets me specify font and font size for it?
it shouldnt be very complicated with rmagick, but i just dont wanna
reinvent the wheel...

thanks!

ciao!
florian



1 Answer

Kaspar Schiess

10/7/2004 8:32:00 PM

0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Florian Weber wrote:
| does anybody of you know of a lib which generates a gif or a png
| out of a dynamic text and lets me specify font and font size for it?
| it shouldnt be very complicated with rmagick, but i just dont wanna
| reinvent the wheel...

Do use RMagick ! (excerpt from text.rb in examples:)

~ #!c:/unix/ruby/bin/ruby -w

~ require 'RMagick'

~ imgl = Magick::ImageList.new
~ imgl.new_image(190,190)

~ sample = Magick::Draw.new
~ sample.stroke('transparent')
~ sample.font_family('times')
~ sample.pointsize(24)

~ sample.font_style(Magick::NormalStyle)
~ sample.text(20,40, 'NormalStyle')

~ # (...)

~ sample.draw(imgl)

~ imgl.write('text.gif')

best regards,

- --
kaspar

semantics & semiotics
code manufacture

www.tua.ch/ruby
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail....

iD8DBQFBZal/Fifl4CA0ImQRAmOyAKCJoxfqwp9zDupBq14mq0ovw2XPSgCgoGIv
5CjtQHMAC+ibjH4WYZMjdYw=
=QAjz
-----END PGP SIGNATURE-----