Using FreeImage in MFC dialog RRS feed

  • Question

  • I would like to display a JPG image in my MFC dialog using "FreeImage"... Supposed to be very simple, but I cannot figure out how...

    I have FreeImage environment setup in my VC++ test program, so I can use it.

    I want to read a JPEG from memory… I have nSize, and ptr to memory. How do I load this?

    And how do I display it in my dialog?

    I DID IT USING IMAGESTONE LIKE THIS (Now I like to use FreeImage):


                  FCObjImage img;

                  img.Load(ptr, nSize, IMG_JPG);

                  // Draw the image into dialog's bitmap area...

                  HDC hdc = ::GetDC(m_staticBitmap);

                  RECT   rcDC = { 0, 0, 480, 370 };

                  img.Draw(hdc, rcDC);

    • Edited by mh1000 Friday, April 28, 2017 5:36 PM
    • Moved by Hart Wang Thursday, May 4, 2017 7:25 AM
    Friday, April 28, 2017 5:26 PM

All replies

  • Hi mh1000,

    Thank you for posting here.

    I am not sure that the FreeImage is third product, if yes, the third product will provide a manual for FreeImage. According to MSDN forum policy, I will move the case to off-topic forum.

    For the issue, I have searched some related document about how to display Image on MFC dialog.  

    The document used to GDI+ library.

    Best Regards,


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Monday, May 1, 2017 3:13 AM