Click here to Skip to main content
Click here to Skip to main content

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

By , 25 Oct 2002
 

ImgViewer

Introduction

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.)

References:

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

License

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
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
Generalplease help me correct this Pinmemberipichet13 Apr '04 - 22:41 
Generalmake a 2-d graphics editor for window Pinmemberanurag somani10 Apr '04 - 0:39 
GeneralDialog instead of Document ... PinsussAnonymous12 Jan '04 - 22:36 
GeneralBug in the Program Pinmembersiquin4 Oct '03 - 16:55 
QuestionHow 2 Save The Loaded File and then reload when required PinmemberVikrant Vikrant17 Jul '03 - 2:41 
Generalhelp me PinsussAnonymous5 Nov '02 - 14:53 
Generalcan't load BMP Pinsussxipeng31 Oct '02 - 20:48 11 
Generalerror PinsussAnonymous31 Oct '02 - 15:35 
GeneralAt least! PinmemberDaniel Turini26 Oct '02 - 21:46 
Generalthis is poor PinmemberMr. Pickles26 Oct '02 - 19:13 

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

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