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

ID: Q218972


The information in this article applies to:


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 file is available for download from the Microsoft Software Library:

LOADPIC.EXE
Release Date: Apr-02-1999

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:
Q119591 How to Obtain Microsoft Support Files from Online Services


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: June 14, 1999