How To Load and Display Graphics Files w/LOADPIC.EXE

ID: Q218972


The information in this article applies to:
  • Microsoft Visual C++, 32-bit Editions, version 6.0
  • Microsoft Win32 Application Programming Interface (API)


SUMMARY

Loadpic.exe is a sample that shows how to load graphics files like .gif, .jpg, .bmp, .ico, .emf, .wmf, and displays them. To do this, use functionality built into OleLoadPicture() which converts these different formats to an IPicture interface. We can then use IPicture::Render() to display them.


MORE INFORMATION

The following files are available for download from the Microsoft Download Center. Click the file names below to download the files:


Loadpic.exe

For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address

http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

Aside from IPicture::Render, you can also display the picture using other functions. You can use BitBlt() for bitmaps, or PlayMetaFile() for metafiles. You can also extract the handle to the picture by calling IPicture::get_Handle(). You can cast the handle to the appropriate type; that is, for example HBITMAP, HICON, and HMETAFILE. To determine what type of handle to cast it to, call IPicture::get_Type().

Additional query words: bitmap bitmaps jpeg gif89 icons icon enhanced metafile meta file

Keywords : kbfile kbActiveX kbCOMt kbGDI kbMFC
Version : winnt:6.0
Platform : winnt
Issue type : kbhowto


Last Reviewed: December 11, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.