Thread: converting JPEG to BMP in memory

  1. #1
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195

    converting JPEG to BMP in memory

    Im trying to convert a JPEG image, which ive already loaded into memory, into a BMP (also in memory). I tried using the libjpeg release from IJG but it has over 100+ errors in it and refuses to compile. Can anyone provide an example using the GDI to process images entirely in memory.

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    One approach would be to use OleLOadPicture and/or OleLoadPicturePath; there's an example here.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Well, the whole thing is I already have the image in memory, so it isnt from a stream source technically. Although I think it might work with HINTERNET style handles.

  4. #4
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    I ended up using CxImage, which is based on the IJG code, but comes with all the project files, and compiles without any editing under VC++ 6.0. It supports direct memory to memory conversion to and from multiple formats, including JPG BMP PNG TIFF and others.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question regarding Memory Leak
    By clegs in forum C++ Programming
    Replies: 29
    Last Post: 12-07-2007, 01:57 AM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Suggestions on this C style code
    By Joelito in forum C Programming
    Replies: 11
    Last Post: 06-07-2007, 03:22 AM
  4. Shared Memory - shmget questions
    By hendler in forum C Programming
    Replies: 1
    Last Post: 11-29-2005, 02:15 AM
  5. Memory allocation and deallocation
    By Micko in forum C++ Programming
    Replies: 3
    Last Post: 08-19-2005, 06:45 PM