Click here to Skip to main content
12,552,693 members (57,217 online)
Click here to Skip to main content
Add your own
alternative version


54 bookmarked

An Image (GIF, JPEG, BMP, ICO, WMF and EMF) Viewer

, 25 Oct 2002
Rate this:
Please Sign up or sign in to vote.
A sample that can load, display, and print graphics files.



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 IPicture interface 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:

Q218972 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 the OleLoadPicture() function instead of the OleLoadPicturePath() function.)

Q141921 HOWTO: How to Support Two File Extensions per MFC Document Type
Q198538 DocMgrEx.exe Assoc Multiple File Extensions w/1 Doc Type


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Chen Su
Software Developer
Canada Canada
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralRe: can't load BMP Pin
Anonymous1-Nov-02 17:25
sussAnonymous1-Nov-02 17:25 
GeneralRe: can't load BMP Pin
Chen Su1-Nov-02 18:53
memberChen Su1-Nov-02 18:53 
GeneralRe: can't load BMP Pin
Anonymous2-Nov-02 4:30
memberAnonymous2-Nov-02 4:30 
GeneralRe: can't load BMP Pin
Chen Su2-Nov-02 12:22
memberChen Su2-Nov-02 12:22 
Generalerror Pin
Anonymous31-Oct-02 15:35
sussAnonymous31-Oct-02 15:35 
GeneralRe: error Pin
Christian Graus31-Oct-02 15:42
memberChristian Graus31-Oct-02 15:42 
GeneralRe: error Pin
Chen Su31-Oct-02 15:55
memberChen Su31-Oct-02 15:55 
GeneralAt least! Pin
Daniel Turini26-Oct-02 21:46
memberDaniel Turini26-Oct-02 21:46 
Someone with taste!

Opus 35 is a nice Sonata from Chopin, but SO long! If you're playing it, congrats!
Oh, and Opus 35 has 4 nice movements, don't stick to the Marche Funèbre, the other 3 movements are much more beautiful.

But the code could add something new...

lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
Generalthis is poor Pin
Mr. Pickles26-Oct-02 19:13
memberMr. Pickles26-Oct-02 19:13 
GeneralRe: this is poor Pin
Shog926-Oct-02 19:11
memberShog926-Oct-02 19:11 
GeneralRe: this is poor Pin
Black Cat27-Oct-02 3:04
memberBlack Cat27-Oct-02 3:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.161021.1 | Last Updated 26 Oct 2002
Article Copyright 2002 by Chen Su
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid