Jpg

This is a discussion on Jpg within the Windows Programming forums, part of the Platform Specific Boards category; No MFC just API,but i don't know how to put a jpg image in a window.....help!!!!...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    4

    Red face Jpg

    No MFC just API,but i don't know how to put a jpg image in a window.....help!!!!

  2. #2
    V
    Guest

    Re: Jpg

    Originally posted by kaas
    No MFC just API,but i don't know how to put a jpg image in a window.....help!!!!
    Well, normal windows GDI functions can ONLY read in bitmaps with palettes, so normally, this wouldn't be possible unless you wanted to cod ehte reading/writing yourself, or you got a 3rd party graphics library.

    However, with GDI+, MS has added support for the JPG format. See

    http://www.codeguru.com/gdi/GDIPlus.html

    for general information on how to get this working for you. Note that you'll need to make small changes to the example code to get it to compile outside of MSVC (mainly changing how you tell the compiler to link the necessary library) but this should put you on the right track, anyway.

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    411
    You should look into DevIL (Developers Image Library), its targeted for the gamers, but it could work for you. If you can get it to work it can load and apply filters to any image format there is.

    DevIL

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,853
    Someone asked this before.

    If you search through the threads you should be able to find links two more jpg libaries.

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    4

    thanks

    thanks anyway
    but i don't want to use a dll ,it just not include in the windows system.i am finding a diffucult way,a classical method to do this.
    thanks... maybe some api can do this such as SetDIBitsToDevice,
    StretchDIBits,OleLoadPicture....

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    412

    Re: thanks

    Originally posted by kaas
    thanks anyway
    but i don't want to use a dll ,it just not include in the windows system.i am finding a diffucult way,a classical method to do this.
    thanks... maybe some api can do this such as SetDIBitsToDevice,
    StretchDIBits,OleLoadPicture....
    There IS none. GDI+ is the closest to a "classical method" there is -- this actually DOES ship on newer MS OS's, but if you're using traditional WinAPI GDI commands, the one and only format you can read without coding yourself is an paletted BMP.

    GDI+ was specifically designed, among other things, to address this issue.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading metadata from jpg
    By TriKri in forum C Programming
    Replies: 2
    Last Post: 06-18-2008, 01:41 AM
  2. Downloading and displaying a jpg file
    By maxorator in forum Windows Programming
    Replies: 13
    Last Post: 11-30-2006, 05:52 AM
  3. How Dispaly JPG images in VC++
    By darcome in forum Windows Programming
    Replies: 10
    Last Post: 10-01-2002, 01:52 AM
  4. Jpeg , Jpg
    By Sunny in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 04-10-2002, 12:26 PM
  5. StretchBlt and JPG
    By novacain in forum Windows Programming
    Replies: 0
    Last Post: 09-28-2001, 03:05 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21