Help and Support
 

powered byLive Search

How to load graphics files and display them in Visual C++

Article ID:218972
Last Review:May 22, 2008
Revision:8.0
This article was previously published under Q218972
On This Page
Note Microsoft Visual C++ 2008, Microsoft Visual C++ 2005, Microsoft Visual C++ 2003, 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.

Back to the top

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.

Back to the top

MORE INFORMATION

Visual C++ 6.0

The following file is available for download from the Microsoft Download Center:
DownloadDownload the Loadpic.exe package now. (http://download.microsoft.com/download/vc60pro/samp37/1/win98/en-us/loadpic.exe)
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 (http://support.microsoft.com/kb/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.

Back to the top

Visual C++ .NET

The following file is available for download from the Microsoft Download Center:
DownloadDownload the Loadpicvcnet.exe package now. (http://download.microsoft.com/download//visualstudionet/sample/1.14/win98mexp/en-us/loadpicvcnet.exe)
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 (http://support.microsoft.com/kb/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.

Back to the top


APPLIES TO
Microsoft Visual C++ 2005 Express Edition
Microsoft Visual C++ .NET 2003 Standard Edition
Microsoft Visual C++ .NET 2002 Standard Edition
Microsoft Visual C++ 6.0 Professional Edition
Microsoft Visual C++ 6.0 Enterprise Edition
Microsoft Visual C++, 32-bit Learning Edition 6.0
Microsoft Win32 Application Programming Interface
Microsoft Visual C++ 2008 Express Edition

Back to the top

Keywords: 
kbsweptvs2008 kbfunctions kbinfo kbdownload kbfile kbgdi kbhowto KB218972

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.