Re: Where can I find any samples about using jpeg in gtk?
- From: Dennis Gajudo <dennis gajudo flex-p com>
- To: "Ronald S. Bultje" <rbultje ronald bitfreak net>
- Cc: liguo503 hotmail com, gtk-list gnome org
- Subject: Re: Where can I find any samples about using jpeg in gtk?
- Date: Tue, 30 Nov 2004 18:42:24 +0800
Hi Ronald,
Thanks for the link.
I've already found a solution to display a jpeg image file using GTK+.
I have used the the IJG code to read the jpeg file into an RGB buffer
and then call the gdk_draw_rgb_image().
Here's the code snippet:
===========================================
pic=malloc(3*320*240)
jpegread("filename", &width, &height, pic); //refer to libjpeg.doc at
www.ijg.org <http://www.ijg.org>
gdk_draw_rgb_image (pixmap,
drawing_area->style->white_gc, 0, 0, 320,
240, GDK_RGB_DITHER_NORMAL, pic,
960);
free (pic);
==========================================
You need to have the jpeglib.h and libjpeg.a to compile successfully.
Regards,
Dennis
Ronald S. Bultje wrote:
Hi Dennis,
On Fri, 2004-11-19 at 12:57, Dennis Gajudo wrote:
Where can I find any samples about using jpeg in gtk?
Have a look at GdkPixbuf and the GtkImage widget in Gtk+-2.0. They're
what you're looking for. See the Gtk+ website (http://www.gtk.org/) for
code examples.
Ronald
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]