Re: GdkPixbuf makes PNG look jaggy



"Jason Bodnar" <jason shakabuku org> writes: 
> # Load and pack the logo
> my $logo = Gtk::Gdk::Pixbuf->new_from_file(PHOTOGAL_LOGO);
> my ($pixmap, $mask) = $logo->render_pixmap_and_mask(100);
> $hbox->pack_start(new Gtk::Pixmap($pixmap, $mask), TRUE, TRUE, 0);

This is going to change the full alpha channel of the pixbuf into a
one-bit mask, so will make the edges ragged if the PNG is antialiased.

> What am I doing wrong? Is there a better way to display a png than converting
> it to a Gtk::Pixmap?

Using Gtk::Image with GTK 2.0 is easiest, but I don't know when the
Perl bindings will be updated of if they are already.

Otherwise, try just drawing your pixbuf to a drawing area. See the
"scribble" chapter in the GTK tutorial to get the general idea, or the
demos that come with gdk-pixbuf.

Havoc



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