Results 1 to 3 of 3
Is it possible to display a JPEG image using gdk_draw_rgb_image()?
I think that I need first to read the JPEG image into an RGB buffer before using
this function. Any ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-19-2004 #1Just Joined!
- Join Date
- Oct 2004
- Posts
- 10
JPEG display using GTK
Is it possible to display a JPEG image using gdk_draw_rgb_image()?
I think that I need first to read the JPEG image into an RGB buffer before using
this function. Any suggestion on how to do this.
- 11-19-2004 #2Linux Guru
- Join Date
- Mar 2003
- Location
- Wisconsin
- Posts
- 1,907
This is also posted in Art & Imaging.
JeremyRegistered Linux user #346571
"All The Dude ever wanted was his rug back" - The Dude
- 11-24-2004 #3Just Joined!
- Join Date
- Oct 2004
- Posts
- 10
I've already found a solution to display a jpeg image file using gdk_draw_rgb_image().
I have used the the IJG code to read the jpeg file into an RGB buffer.
Here's the code snippet:
===========================================
pic=malloc(3*320*240)
jpegread("filename", &width, &height, pic); //refer to libjpeg.doc at 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,
Den


Reply With Quote
