Re: Newbie question - replacing Gtk2::Image with another
- From: Gavin Brown <gavin brown uk com>
- To: John Ello <jello waste org>
- Cc: gtk-perl-list gnome org
- Subject: Re: Newbie question - replacing Gtk2::Image with another
- Date: 21 Aug 2003 09:43:05 +0100
Another question I have is how to resize the image before
displaying.
Create a GdkPixbuf, and use scale_simple(), eg:
my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file($file);
$pixbuf = $pixbuf->scale_simple($new_width, $new_height, 'bilinear');
$image->set_from_pixbuf($pixbuf);
That should do it.
G.
--
Gavin Brown
e: gavin brown uk com
w: http://jodrell.net/
PGP/GPG key ID: 891D8FCA
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]