Click here to Skip to main content
Licence 
First Posted 25 Oct 2002
Views 220,010
Bookmarked 52 times

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

By | 25 Oct 2002 | Article
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

About the Author

Chen Su

Software Developer

Canada Canada

Member



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. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 5 Pinmembermanoj kumar choubey20:57 26 Feb '12  
QuestionMultipage EMF viewer PinmemberLoris Rinaldo4:22 10 Nov '11  
AnswerRe: Multipage EMF viewer PinmemberChen Su15:14 10 Nov '11  
GeneralRe: Multipage EMF viewer PinmemberLoris Rinaldo10:19 18 Nov '11  
GeneralLINK : fatal error LNK1104: cannot open file "uafxcwd.lib" PinmemberBee cute3:26 3 Mar '11  
AnswerRe: LINK : fatal error LNK1104: cannot open file "uafxcwd.lib" PinmemberAlbert Holguin7:13 19 Apr '11  
Generalcontact Pinmemberlihuai22:30 26 Jan '10  
GeneralImage disappear Pinmembermazhar_cse23:09 15 Mar '07  
GeneralRe: Image disappear PinmemberChen Su8:40 16 Mar '07  
GeneralImage disappear Pinmembermazhar_cse23:08 15 Mar '07  
Generalplease help me make program contrast bmp PinmemberHoangManh17:45 4 Jun '06  
GeneralHot to print Images Pinmembergonetil5:43 6 Apr '05  
GeneralRe: Hot to print Images PinmemberChen Su16:17 6 Apr '05  
GeneralRotate a picture PinmemberAlex Evans16:35 3 Jan '05  
GeneralIPicutre data Pinmemberkowal6:55 19 Oct '04  
Generalplease help me correct this Pinmemberipichet22:41 13 Apr '04  
Generalmake a 2-d graphics editor for window Pinmemberanurag somani0:39 10 Apr '04  
GeneralDialog instead of Document ... PinsussAnonymous22:36 12 Jan '04  
GeneralRe: Dialog instead of Document ... PinmemberChen Su8:18 13 Jan '04  
GeneralBug in the Program Pinmembersiquin16:55 4 Oct '03  
GeneralRe: Bug in the Program PinmemberChen Su18:42 4 Oct '03  
GeneralRe: Bug in the Program Pinmembertico_tech10:23 6 Oct '03  
QuestionHow 2 Save The Loaded File and then reload when required PinmemberVikrant Vikrant2:41 17 Jul '03  
Generalhelp me PinsussAnonymous14:53 5 Nov '02  
GeneralRe: help me PinmemberChristian Graus15:10 5 Nov '02  

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.

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