# Magick::Image in gtk

**URL:** <https://www.ruby-forum.com/t/magick-image-in-gtk/104884>\
**Category:** Ruby-Gnome 2\
**Created:** [May 23, 2007, 3:47pm UTC](https://www.ruby-forum.com/t/magick-image-in-gtk/104884 "2007-05-23T15:47:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [May 23, 2007, 3:47pm UTC](https://www.ruby-forum.com/t/magick-image-in-gtk/104884/1 "2007-05-23T15:47:14Z")

</div>

Hi,

I am experiencing problem to import a Magick::Image in a Gtk::Image to  
display it.  
I use the to\_blob() method from Magick::Image to get the data and pass  
it to a Gdk::Pixbuf with

pix=Gdk::Pixbuf.new(blob, Gdk::Pixbuf::ColorSpace::RGB, false, 8,  
image\_width, image\_height, 3\*image\_width)

Perhaps the problem comes from the last argument ‘rowstride’ ? how I  
can compute it ?

and then I created an Gtk::Image with:

img = Gtk::Image.new  
img.pixbuf=pix

Did someone have ever done that ?

thanks,

david

* * *

This [SF.net](http://SF.net) email is sponsored by DB2 Express  
Download DB2 Express C - the FREE version of DB2 express and take  
control of your XML. No limits. Just data. Click to get it now.  
[http://sourceforge.net/powerbar/db2/](http://sourceforge.net/powerbar/db2/)
