Click here to Skip to main content
15,882,114 members
Articles / Desktop Programming / MFC
Article

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

Rate me:
Please Sign up or sign in to vote.
3.68/5 (15 votes)
25 Oct 2002 286.1K   7.1K   57   47
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


Written By
Software Developer
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Generalhelp me Pin
Anonymous5-Nov-02 14:53
Anonymous5-Nov-02 14:53 
GeneralRe: help me Pin
Christian Graus5-Nov-02 15:10
protectorChristian Graus5-Nov-02 15:10 
Let's see.....

1. The question has little to nothing to do with this article.
2. You're not committed enough to this community to get an account or even to indicate that you're going to check back for a reply.
3. You didn't ask in the proper forums.
4. You didn't say please.

On what level do you think this is the way to solve your problem ?

Christian

No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002

Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002

During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
GeneralRe: help me Pin
Anonymous5-Nov-02 15:24
Anonymous5-Nov-02 15:24 
GeneralRe: help me Pin
Christian Graus5-Nov-02 15:33
protectorChristian Graus5-Nov-02 15:33 
GeneralRe: help me Pin
Anonymous18-Dec-07 5:39
Anonymous18-Dec-07 5:39 

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.