Re: Saving a pixmap which is larger than visible screen size



On Sat, Oct 28, 2006 at 12:38:22PM -0400, zentara wrote:
...
> Basically what I have, is a DrawingArea that is
> 2400 X 400.  Then I put a pixmap (of same size)
> onto it, for persistence. Then I place this into
> a ScrolledWindow.
> I then write lines to it ( 2 points at a time), like a 24-hour  
> strip chart recorder. It all works fine, except where I would
> like to save the entire 2400x400 area.
> 
> My 2 failed methods are below. The both run, but they only
> seem to correctly capture the visible portion of the ScrolledWindow,
> and make an incorrect 2400 X 400 jpg out of it. Like 4 identical
> images side-by-side..... not a full 2400 pixel width.
...
> 
> Using the normal method, (in Perl)
> #########################################################
> # create blank pixbuf to hold the image 
> my $gdkpixbuf = Gtk2::Gdk::Pixbuf->new ('rgb',0, 8, 2400,  400);              
> 
> $gdkpixbuf->get_from_drawable ($area->window,                                            
>                       undef, 0, 0, 0, 0, 2400, 400);                                         
>                                                                                           
> #only jpeg and png is supported !!!! it's 'jpeg', not 'jpg'                               
> $gdkpixbuf->save ("$0.jpg", 'jpeg', quality => 100);          
> ########################################################

Here's a guess:  I think of a "drawable" as an area on the screen.  I
think you're pulling the image from the wrong object.

It's hard to do better than guessing because I can't tell exactly what
type the "$area" variable is, and what the "window" member is.  Please
post more detail.  If possible, post a working, but concise, example of
the problem.  This will make more info available *and* people will be
able to test it.

- Anna





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]