The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
This sample is an MFC application using the document/view architecture
that can load, display and print graphics files such as GIF, JPEG, BMP (bitmap),
ICO (icon), WMF (metafile) and EMF (Win32-enhanced metafile). It shows
- how to use the
OleLoadPicturePath() function and the
to load and display those graphics files.
(Look into the ImgViewerDoc.cpp, ImgViewerView.cpp and MainFrm.cpp files.)
- how to support more than one file extension per MFC document type.
(Look into the MulExtDocTmp.cpp, MulExtDocTmp.h and ImgViewer.cpp files.)
Please see the following article in the Microsoft Knowledge Base:
How To Load and Display Graphics Files w/LOADPIC.EXE
(Note that LOADPIC.EXE does not handle palettes. As a result, it
won't display a 256-color image correctly in 256-color mode. Also, it uses
OleLoadPicture() function instead of the
HOWTO: How to Support Two File Extensions per MFC Document Type
DocMgrEx.exe Assoc Multiple File Extensions w/1 Doc Type