Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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.

  2. #2
    Linux Guru
    Join Date
    Mar 2003
    This is also posted in Art & Imaging.

    Registered Linux user #346571
    "All The Dude ever wanted was his rug back" - The Dude

  3. #3
    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:

    jpegread("filename", &width, &height, pic); //refer to libjpeg.doc at

    gdk_draw_rgb_image (pixmap,
    drawing_area->style->white_gc, 0, 0, 320,
    240, GDK_RGB_DITHER_NORMAL, pic,

    free (pic);

    You need to have the jpeglib.h and libjpeg.a to compile successfully.


  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts