From: Detlef Reichl Date: 2006-01-11T05:30:39+09:00 Subject: Re: You want a Ruby extension? Talk to me, baby Am Mittwoch, den 11.01.2006, 04:44 +0900 schrieb mental@rydia.net: > Quoting Eric Hodel : > > > You don't need an extension for that. You've already got > > Ruby-GTK and RMagick. Just glue them together with Ruby. > > He's probably wondering specifically how to get from an RMagick > image to a GdkPixbuf or similar (a question I don't know the answer > to offhand), in pure Ruby. > Its very easy: my_pixbuf = Gdk::Pixbuf.new(rmagic_image.to_blob, Gdk::Pixbuf::ColorSpace::RGB, false, 8, image_width, image_height, image.width * 3) the API reference for the gdk-pixbuf call is: Gdk::Pixbuf.new(data, colorspace, has_alpha, bit_per_sample, width, height, rowstride) rmagic_image.to_blob returns the pixel data cheers detlef > -mental >