Thread: How Dispaly JPG images in VC++

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    35

    How Dispaly JPG images in VC++

    I need to display a JPG image as backgorund of a DialogBox. Can you help me??

    Hovewer I know to program in C, so I don't know classes and stuff like that. There a way to display JPG only using C code??

    Thank you for your help

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    first, I believe some of the newer versions of windows support jpegs but not all win32 does.

    I would suggest you use one of the libraries out there for conversion to DIB. I've used two. Intel Jpeg library downloadable for free from the intel site, and the "independant JPEG group" or something like that has one with the source available.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    The intel jpeg library is no longer available free. It has been swallowed up by the larger primitives library and the only download intel offers now is an evaluation edition of the library which i believe is pretty much bugger all use to anyone.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  4. #4
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    oh, I didn't know that. The independant Jpeg group one is open source though. It is however nasty, macro filled C. good luck
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  5. #5
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    here's the link
    http://www.ijg.org/
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  6. #6
    Registered User
    Join Date
    Jun 2002
    Posts
    35
    but VC++ has not functions about displaying JPG??

  7. #7
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    VC++ is not the question. The API your app will be using is. I understand it is possible to load a JPEG in some later versions of windows but not all 32 bit support it. 32 bit includes everything Win95 and up.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  8. #8
    Registered User
    Join Date
    Jun 2002
    Posts
    35
    ok, i'll look at jpeg organization

  9. #9
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Unless you HAVE to use a jpg as the background, convert to a BMP which the WIN32 API can handle and use LoadImage(), CreateCompatibleDC() ect.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  10. #10
    Registered User
    Join Date
    Jun 2002
    Posts
    35
    The problem is that my application, for what it does, using BMP is very big in bytes

  11. #11
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    I recomend Smaller Animals software's Image Source library. It can convert from most common formats to DIB's or DDB's.

    Is well supported, frequently updated, well commented and fast. (but costs)

    look here
    http://www.smalleranimals.com/isource.htm
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. mirroring website with images on external host
    By cyberfish in forum Tech Board
    Replies: 1
    Last Post: 09-08-2008, 06:50 PM
  2. Images
    By _Nate_ in forum C Programming
    Replies: 4
    Last Post: 05-18-2008, 10:50 PM
  3. Downloading and displaying a jpg file
    By maxorator in forum Windows Programming
    Replies: 13
    Last Post: 11-30-2006, 06:52 AM
  4. Compiling images into DLL/EXE?
    By execute in forum Windows Programming
    Replies: 14
    Last Post: 05-28-2006, 06:27 PM
  5. StretchBlt and JPG
    By novacain in forum Windows Programming
    Replies: 0
    Last Post: 09-28-2001, 03:05 AM