IPicture Interface

 

Manages a picture object and its properties. Picture objects provide a language-neutral abstraction for bitmaps, icons, and metafiles. As with the standard font object, the system provides a standard implementation of the picture object. Its primary interfaces are IPicture and IPictureDisp, the latter being derived from IDispatch to provide access to the picture's properties through Automation. A picture object is created with OleCreatePictureIndirect.

The picture object also supports the outgoing interface IPropertyNotifySink, so a client can determine when picture properties change. Because the picture object supports at least one outgoing interface, it also implements IConnectionPointContainer and its associated interfaces for this purpose.

The picture object also supports IPersistStream so that it can save and load itself from an instance of IStream. An object that uses a picture object internally would normally save and load the picture as part of the object's own persistence handling. The function OleLoadPicture simplifies the creation of a picture object based on stream contents.

pasted from MSDN

Sample:

VC++

   1:  // Initialize the PICTDESC struct
   2:  PICTDESC oPDesc;
   3:  oPDesc.cbSizeofstruct = sizeof(oPDesc);
   4:  oPDesc.picType        = PICTYPE_ICON;
   5:  oPDesc.icon.hicon     = hIcon;
   6:      
   7:  // Construct a IPictureDisp interface
   8:  return OleCreatePictureIndirect(&oPDesc, riid, TRUE, (LPVOID *)ppResult);

VBA

   1:  Sub TestIPictureDisp()
   2:      Dim oPic As IPictureDisp
   3:      Set oPic = LoadPicture(
  
  
   
   to the picture>)
  
  
   4:  End Sub
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值