# Camera image display problems

**URL:** <https://www.ruby-forum.com/t/camera-image-display-problems/55060>\
**Category:** Ruby-Gnome 2\
**Created:** [March 16, 2006, 7:07pm UTC](https://www.ruby-forum.com/t/camera-image-display-problems/55060 "2006-03-16T19:07:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [March 16, 2006, 7:07pm UTC](https://www.ruby-forum.com/t/camera-image-display-problems/55060/1 "2006-03-16T19:07:56Z")

</div>

Hello,  
I’m trying to load a grayscale image from a camera into an NArray,  
process it, then display it scaled using Ruby GTK. I’ve tried 2  
methods, both with problems:

1. Use Gdk::Pixbuf#new to wrap the data, then Gdk::Pixbuf#scale to  
copy it into the existing pixbuf in the Gtk::image. This results in  
“[BUG] Segmentation fault” depending on the parameters and the size  
of the window. When it works, it is too slow.

2. Use Gdk::RGB#draw\_gray\_image to draw into a Gtk::DrawingArea, then  
use Gtk::DrawingArea#queue\_draw to refresh the image. This is very  
fast, but consumes memory quickly. The memory leak could easily be  
my fault elsewhere in my C extensions, but on first review it seems  
to be in the GTK section of my code.

If anyone could offer any recommendations or any new display methods,  
I would appreciate it. I’m using Ruby 1.8.4 on OS 10.4.  
Thanks,  
John

* * *

This [SF.Net](http://SF.Net) email is sponsored by xPML, a groundbreaking scripting  
language  
that extends applications into web and mobile media. Attend the live  
webcast  
and join the prime developer group breaking into this new coding  
territory!  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642)
