Loads an image file and an OLE Picture object (IPicture) and returns its interface pointer.
pPicture = Exec_Method( "SYSTEM", "OLELOADPICTURE", FileName )
Name | Required | Description |
---|---|---|
FileName | Yes | Name and path of the image file to load |
The IPicture interface pointer if the image is loaded successfully, or 0 if the method fails.
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.
//// 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
SYSTEM OLEGETPICTUREPROPS method, SYSTEM OLE IUKNOWNRELEASE method.