none
how to load JPEG and PNG images ? RRS feed

  • Question

  • Hello,
    I am developping  an embedded application I have to load Jpeg and Png pictures to display it on the screen. As I have to do some things on it, I have to extract the datain a char* array. I did it for Bmp and Tga pictures because it is no compressed. I tried to use libJpeg and libPng but I didn't manage to use it. Maybe I can compile these libs myself...

    My conf :
    windows XP
    MS Visual Studio 2005
    emulator : Windows Mobile 6 Professional


    Thanks

    PS : I hope I post in the good forum ...
    Wednesday, April 23, 2008 7:06 AM

Answers

  • You can also use the Imaging API, it will handle most of the popular formats including .jpg, .gif, .png.

     

    Check out:

    http://msdn2.microsoft.com/en-us/library/aa918637.aspx

     

    You will first need to create an instance of the IImagingFactory.  You can then load the image using IImagingFactory::CreateImageFromFile to load the image.  With the resuting IImage you can use IImagingFactory::CreateBitmapFromImage.

     

    The imaging factory is far more powerful that what .Net exposes.  It allows you to only decompress the portion of the image you need.

     

    Cheers,

    Jason

     

     

    Wednesday, April 23, 2008 2:40 PM

All replies