Re: rescaling for display



Using gdk_pixbuf is the only real solution.  It's available as a
separate library in gtk 1.2, but it integrated into gtk 2.0.  Very
nice.  I've used it for some time.  Besides supporting alpha-blending,
it can scale images rather nicely.

Michael


On Fri, 2002-08-02 at 08:11, Peter Van Osta wrote:
> Hi,
> 
> I have built a GTK1.2 based application in which I want to display
> images to the screen in an GdkDrawingArea. I have declared:
> 
> guchar my_img[MY_WIDTH * MY_HEIGHT * 3];
> 
> and I display the in the GDHDrawingArea with 'gdk_draw_rgb_image"
> 
> e.g.: gdk_draw_rgb_image (widget->window,
> widget->style->fg_gc[GTK_STATE_NORMAL],
> 	0, 0, MY_WIDTH, MY_HEIGHT,
> 		GDK_RGB_DITHER_MAX, my_img, MY_WIDTH * 3);
> 
> This works fine for images that are of the size MY_WIDTH * MY_HEIGHT. Is
> there a way to rescale images before displaying them ? In this way of
> using a "guchar" type buffer, the "images" are read into a static
> buffer, which is not very flexible.
> 
> Best regards,
> 
> Peter
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
-- 
Public key available from http://students.cs.byu.edu/~torriem


Attachment: signature.asc
Description: This is a digitally signed message part



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