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

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.

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

Comments and Discussions

 
GeneralRe: help me PinmemberChristian Graus5-Nov-02 16:10 
GeneralRe: help me PinsussAnonymous5-Nov-02 16:24 
GeneralRe: help me PinmemberChristian Graus5-Nov-02 16:33 
GeneralRe: help me PinsussAnonymous18-Dec-07 6:39 
Generalcan't load BMP Pinsussxipeng31-Oct-02 21:48 
GeneralRe: can't load BMP PinmemberChristian Graus31-Oct-02 22:31 
GeneralRe: can't load BMP PinsussAnonymous1-Nov-02 0:46 
GeneralRe: can't load BMP PinmemberChristian Graus1-Nov-02 1:40 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/introductiontoresources/resourcereference/resourcefunctions/loadimage.asp[^]
 
There's a bit at the bottom on LoadBitmap, which now that I think of it, supercedes LoadImage. So check out both before deciding which to use.

 
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: can't load BMP PinsussAnonymous1-Nov-02 2:30 
GeneralRe: can't load BMP PinmemberChristian Graus1-Nov-02 7:34 
GeneralRe: can't load BMP PinmemberChen Su1-Nov-02 7:50 
GeneralRe: can't load BMP PinsussAnonymous1-Nov-02 18:25 
GeneralRe: can't load BMP PinmemberChen Su1-Nov-02 19:53 
GeneralRe: can't load BMP PinmemberAnonymous2-Nov-02 5:30 
GeneralRe: can't load BMP PinmemberChen Su2-Nov-02 13:22 
Generalerror PinsussAnonymous31-Oct-02 16:35 
GeneralRe: error PinmemberChristian Graus31-Oct-02 16:42 
GeneralRe: error PinmemberChen Su31-Oct-02 16:55 
GeneralAt least! PinmemberDaniel Turini26-Oct-02 22:46 
Generalthis is poor PinmemberMr. Pickles26-Oct-02 20:13 
GeneralRe: this is poor PinmemberShog926-Oct-02 20:11 
GeneralRe: this is poor PinmemberBlack Cat27-Oct-02 4:04 

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
Web03 | 2.8.1411022.1 | Last Updated 26 Oct 2002
Article Copyright 2002 by Chen Su
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid