Click here to Skip to main content
11,573,408 members (63,081 online)
Click here to Skip to main content

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

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

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

Share

About the Author

Chen Su
Software Developer
Canada Canada
No Biography provided

You may also be interested in...

Comments and Discussions

 
GeneralMy vote of 5 Pin
manoj kumar choubey26-Feb-12 20:57
membermanoj kumar choubey26-Feb-12 20:57 
QuestionMultipage EMF viewer Pin
Loris Rinaldo10-Nov-11 4:22
memberLoris Rinaldo10-Nov-11 4:22 
AnswerRe: Multipage EMF viewer Pin
Chen Su10-Nov-11 15:14
memberChen Su10-Nov-11 15:14 
GeneralRe: Multipage EMF viewer Pin
Loris Rinaldo18-Nov-11 10:19
memberLoris Rinaldo18-Nov-11 10:19 
GeneralLINK : fatal error LNK1104: cannot open file "uafxcwd.lib" Pin
Bee cute3-Mar-11 3:26
memberBee cute3-Mar-11 3:26 
AnswerRe: LINK : fatal error LNK1104: cannot open file "uafxcwd.lib" Pin
Albert Holguin19-Apr-11 7:13
memberAlbert Holguin19-Apr-11 7:13 
Generalcontact Pin
lihuai26-Jan-10 22:30
memberlihuai26-Jan-10 22:30 
GeneralImage disappear Pin
mazhar_cse15-Mar-07 23:09
membermazhar_cse15-Mar-07 23:09 
I can load bitmap image in Dialog or Sdi document. But if another window overlap my imageviewer, image is disappeared.

How can i solve the problem.
GeneralRe: Image disappear Pin
Chen Su16-Mar-07 8:40
memberChen Su16-Mar-07 8:40 
GeneralImage disappear Pin
mazhar_cse15-Mar-07 23:08
membermazhar_cse15-Mar-07 23:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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
Web04 | 2.8.150624.2 | Last Updated 26 Oct 2002
Article Copyright 2002 by Chen Su
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid