How to load graphics files and display them in Visual C++ (218972)
The information in this article applies to:
- Microsoft Visual C++ 2005 Express Edition
- Microsoft Visual C++ .NET (2003)
- Microsoft Visual C++ .NET (2002)
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- Microsoft Win32 Application Programming Interface (API)
This article was previously published under Q218972 Note Microsoft Visual C++ 2005 and Microsoft Visual C++ .NET 2002 support both the managed code
model that is provided by the Microsoft .NET Framework and the unmanaged native
Microsoft Windows code model. The information in this article applies only to
unmanaged Visual C++ code. 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 the OleLoadPicture function. The OleLoadPicture function converts these different
formats to an IPicture interface. We can then use the IPicture::Render function to display
them. MORE INFORMATIONVisual C++ 6.0
The following file is available for download from the Microsoft Download Center:
For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to obtain Microsoft support files from online services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.
Visual C++ .NET
The following file is available for download from the Microsoft Download Center:
Release Date: June 25, 2002
For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to obtain Microsoft support files from online services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.
Aside from the IPicture::Render function, you can also display the
picture using other functions. You can use the BitBlt function for bitmaps, or
the PlayMetaFile function for metafiles. You can also extract the handle to the picture by
calling the IPicture::get_Handle function. 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 the IPicture::get_Type function.
Modification Type: | Major | Last Reviewed: | 1/7/2006 |
---|
Keywords: | kbfunctions kbinfo kbdownload kbfile kbGDI kbhowto KB218972 kbAudDeveloper |
---|
|