Re: Display Portions of an Image

I looked into gdk_pixbuf_copy_area, which almost seemed like it might do the
trick, except that it requires an existing pixbuf to put the copy into.

All you do is create a new pixbuf, taking the arguments from the values of the source pixbuf, then you can 
use the copy_area function no problems.


my $source = Gtk2::Gdk::Pixbuf->new_from_file('wanda.png');

# assume $width and $height are known, or can be calculated

my $dest = Gtk2::Gdk::Pixbuf->new(

# $x_offset is probably some multiple of $width. $y_offset is probably zero.
# $dest_x and $dest_y are also probably zero.


Doesn't that do the trick?


Gavin Brown
e: gavin brown uk com
PGP/GPG key ID: 891D8FCA

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