Find the answer to your Linux question:
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.
  1. #1
    Just 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.

  2. #2
    Linux Guru
    Join Date
    Mar 2003
    Location
    Wisconsin
    Posts
    1,907
    This is also posted in Art & Imaging.

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

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

  4. $spacer_open
    $spacer_close

Posting Permissions

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