oi10:presentation_server:oleloadpicture_method_system

OLELOADPICTURE Method (System)

Loads an image file and an OLE Picture object (IPicture) and returns its interface pointer.

pPicture = Exec_Method( "SYSTEM", "OLELOADPICTURE", FileName )

NameRequiredDescription
FileNameYesName 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.

  • oi10/presentation_server/oleloadpicture_method_system.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1