Re: image resizing



On Fri, 2003-07-11 at 23:13, ritwik kumar wrote:
hey,
    how do i scale images to my desired size and then
display using GtkImage widget? othetwise on part of
the image shows when window is smaller than the image.
Please help.

GdkPixbuf pixbuf = gdk_pixbuf_new_from_file (filename, NULL);

scaled_pixbuf = gdk_pixbuf_scale_simple (pixbuf,
                                         width,
                                         height,
                                         GDK_INTERP_BILINEAR);
GtkImage image = gtk_image_new_from_pixbuf (scaled_pixbuf);

Hope this helps
--
J5




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