OLELOADPICTURE Method (System)
Description
Loads an image file and an OLE Picture object (IPicture) and returns its interface pointer.
Syntax
pPicture = Exec_Method( "SYSTEM", "OLELOADPICTURE", FileName )
Parameters
Name | Required | Description |
---|---|---|
FileName | Yes | Name and path of the image file to load |
Returns
The IPicture interface pointer if the image is loaded successfully, or 0 if the method fails.
Remarks
This method uses the OleCreatePictureIndirect or OleLoadPicturePath Windows API functions to load the picture object. For further information on these functions please see the MSDN website.
Example
//// Extract the width and height of an OLE Picture, given it's // //// interface pointer// PicFile = "C:\temp\myPic.bmp" pPicture = Exec_Method( "SYSTEM", "OLELOADPICTURE", PicFile ) If pPicture Then PicProps = Exec_Method( "SYSTEM", "OLEGETPICTUREPROPS", pPicture ) If BLen( PicProps ) Then PicW = PicProps<4> PicH = PicProps<5> End //// Release the picture// Exec_Method( "SYSTEM", "OLEIKNOWNRELEASE", pPicture ) End
See Also
SYSTEM OLEGETPICTUREPROPS method, SYSTEM OLE IUKNOWNRELEASE method.