locked
How to display a jpg image on a MFC dialog form RRS feed

  • Question

  • Hello,
    i'm using Visual Studio 2003.
    In a MFC dialg form i should show a jpg image, so i added a Picture Control;
    then in Resources i tried to imported a jpg image (in dialogbox window many files extensions are supported, like jpg,gif,png,etc...) but i noticed i can only import BMP file (with this file format in fact i never get difficulties). Jpg, gif & other file formats if imported they are classified (in Reources Tree) like a general item and displaiyd in binary mode.

    Anybody knows a way to import a non bmp image (jpg, gif, etc)?
    Or anybody knows another control (activex) usefull to manage many images types?

    I hope somebody can help me Smile

    Thanx

    Lewix
    Monday, April 11, 2005 8:56 AM

Answers

  • See: SAMPLE: How to Load and Display Graphics Files with LOADPIC.EXE
    http://support.microsoft.com/kb/218972/en-us

    See: Rendering GIF, JPEG, Icon, or Bitmap Files with OleLoadPicture
    http://www.codeproject.com/bitmap/render.asp
    Monday, April 11, 2005 10:16 AM
  • Thanks Jochen!
    I found also a COM component "Microsoft Forms Image 2.0" wicht lets you to show and manage a lots of types of images; but i think it is not a "pure" mfc control.
    I hoped there was a control because i have to show an image on dialog form, then manage OnClick event and move it runtime.

    If you know other ways to do this i am here! Smile
    Otherwise i will follow the examples explained on the links you gave me.

    Lewix
    Monday, April 11, 2005 10:51 AM

All replies

  • See: SAMPLE: How to Load and Display Graphics Files with LOADPIC.EXE
    http://support.microsoft.com/kb/218972/en-us

    See: Rendering GIF, JPEG, Icon, or Bitmap Files with OleLoadPicture
    http://www.codeproject.com/bitmap/render.asp
    Monday, April 11, 2005 10:16 AM
  • Thanks Jochen!
    I found also a COM component "Microsoft Forms Image 2.0" wicht lets you to show and manage a lots of types of images; but i think it is not a "pure" mfc control.
    I hoped there was a control because i have to show an image on dialog form, then manage OnClick event and move it runtime.

    If you know other ways to do this i am here! Smile
    Otherwise i will follow the examples explained on the links you gave me.

    Lewix
    Monday, April 11, 2005 10:51 AM
  • Hi,

    I think you can use GDI+ library to display these type of files on your window.

    Regards,
    Jahfer
    Monday, April 11, 2005 1:47 PM
  • GDI+ Library is very good, but platforms not Windows XP needs SDK framework (if i'm not wrong). I would like to use standard controls, so the application will work on every OS.

    Microsoft Forms Image 2.0 COM controls are not bad, support jpg,gif and many other formats. For now... maybe using these my opinion will change Smile


    Monday, April 11, 2005 3:31 PM
  • "Microsoft Forms Image 2.0" is a little fat/huge for you, I think.
    You may write a class derived from CStatic, and use OleLoadPicture/IPicture... in your class, ,,,

    Monday, April 11, 2005 6:01 PM
  • I found also CImage. Very nice

    Lewix
    Tuesday, April 12, 2005 12:15 AM
  • Hi Lewix!

    Can you post your example code? I've to do the same thing! I've a dialog and I need to show in this dialog the preview of an image stored in c:

    Thanks!

    Thursday, July 12, 2012 10:40 PM