|
|
|
IPicture Interface |
|
IID_IPicture |
{7BF80980-BF32-101A-8BBB-00AA00300CAB} |
|
The 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. Since 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 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.
|
|
Methods in VTable order |
|
|
IUnknown Methods |
Description |
|
QueryInterface |
Returns pointers to supported interfaces. |
|
AddRef |
Increments reference count. |
|
Release |
Decrements reference count. |
|
IPicture Methods |
Description |
|
get_Handle |
Returns the Windows GDI handle of the picture managed within this picture object. |
|
get_hPal |
Returns a copy of the palette currently used by the picture object. |
|
get_Type |
Returns the current type of the picture. |
|
get_Width |
Returns the current width of the picture in the picture object. |
|
get_Height |
Returns the current height of the picture in the picture object. |
|
Render |
Draws the specified portion of the picture onto the specified device context, positioned at the specified location. |
|
set_hPal |
Sets the current palette of the picture. |
|
get_CurDC |
Returns the current device context into which this picture is selected. |
|
SelectPicture |
Selects a bitmap picture into a given device context, returning the device context in which the picture was previously selected as well as the picture's GDI handle. |
|
get_KeepOriginalFormat |
Returns the current value of the picture object's KeepOriginalFormat property. |
|
put_KeepOriginalFormat |
Sets the picture object's KeepOriginalFormat property. |
|
PictureChanged |
Notifies the picture object that its picture resource changed. |
|
SaveAsFile |
Saves the picture's data into a stream in the same format that it would save itself into a file. |
|
get_Attributes |
Returns the current set of the picture's bit attributes. |
|
GetHandle |
|
FUNCTION IPicture_GetHandle ( _ BYVAL pthis AS DWORD PTR _ , BYREF phandle AS LONG _
) AS LONG
|
|
GethPal |
|
FUNCTION IPicture_GethPal ( _ BYVAL pthis AS DWORD PTR _ , BYREF phpal AS DWORD _ ) AS LONG
END FUNCTION
|
|
GetType |
|
FUNCTION IPicture_GetType ( _ BYVAL pthis AS DWORD PTR _ , BYREF ptype AS INTEGER _ ) AS LONG
|
|
GetWidth |
|
FUNCTION IPicture_GetWidth ( _ BYVAL pthis AS DWORD PTR _ , BYREF pwidth AS LONG _ ) AS
LONG
|
|
GetHeight |
|
FUNCTION IPicture_GetHeight ( _ BYVAL pthis AS DWORD PTR _ , BYREF pheight AS LONG _ ) AS LONG
|
|
Render |
|
FUNCTION IPicture_Render ( _ BYVAL pthis AS DWORD PTR, _ BYVAL hdc AS LONG, _ BYVAL x AS LONG, _ BYVAL y AS LONG, _ BYVAL cx AS LONG, _
BYVAL cy AS LONG,
_ BYVAL ySrc AS LONG, _ BYVAL cxSrc AS LONG, _ BYVAL cySrc AS LONG, _ BYREF prcWBounds AS RECT _ )
AS LONG
|
|
SethPal |
|
FUNCTION IPicture_SethPal ( _ BYVAL pthis AS DWORD PTR _ , BYVAL phpal AS DWORD _ ) AS LONG
|
|
GetCurDC |
|
FUNCTION IPicture_GetCurDC ( _ BYVAL pthis AS DWORD PTR _ , BYREF phdcOut AS LONG _ ) AS LONG
|
|
SelectPicture |
|
FUNCTION IPicture_SelectPicture ( _ BYVAL pthis AS DWORD PTR _ , BYVAL hdcIn AS LONG _ , BYREF phdcOut AS LONG _ , BYREF phbmpOut AS LONG _ ) AS LONG
|
|
GetKeepOriginalPicture |
|
FUNCTION IPicture_GetKeepOriginalFormat ( _ BYVAL pthis AS DWORD PTR _ , BYREF pfkeep AS INTEGER _ ) AS
LONG
|
|
SetKeepOriginalPicture |
|
FUNCTION IPicture_SetKeepOriginalFormat ( _ BYVAL pthis AS DWORD PTR _ , BYVAL pfkeep AS INTEGER _ ) AS
LONG
|
|
PictureChanged |
|
FUNCTION IPicture_PictureChanged ( _ BYVAL pthis AS DWORD PTR _ ) AS LONG
|
|
SaveAsFile |
|
FUNCTION IPicture_SaveAsFile ( _ BYVAL pthis AS DWORD PTR _ , BYVAL pstm AS DWORD PTR _ , BYVAL fSaveMemCopy AS INTEGER _ , BYREF pcbSize AS LONG _ )
AS LONG
|
|
GetAttributes |
|
FUNCTION IPicture_GetAttributes ( _ BYVAL pthis AS DWORD PTR _ , BYREF pdwAttr AS LONG _ ) AS LONG
|
|
IPictureDisp |
||||||||||||||||||||
|
The IPictureDisp interface exposes the picture object's properties through Automation. It provides a subset of the functionality available through IPicture methods.
The dispIDs for the various picture properties are the following:
DISPID_PICT_HANDLE = 0 DISPID_PICT_HPAL = 2 DISPID_PICT_TYPE = 3 DISPID_PICT_WIDTH = 4 DISPID_PICT_HEIGHT = 5 DISPID_PICT_RENDER = 6
Each property in the IPictureDisp interface includes a get_PropertyName method if the property supports read access and a put_PropertyName method if the property supports write access. Most of the properties support read access only with the exception of the hPal property.
|
|
CreatePictureIndirect |
|
FUNCTION IPicture_CreatePictureIndirect ( _ BYVAL hPicHandle AS DWORD _ , BYVAL picType AS DWORD _ , BYVAL fOwn AS INTEGER _ , BYREF ppPicture AS DWORD _
)
AS LONG ' manipulated using the IPicture interface riid = GUID$("{00000000-0000-0000-c000-000000000046}") ' Use IDispatch to create an IPictureDisp object
' that can be manipulated using
Automation (Invoke)
IF ISFALSE hPicHandle
THEN FUNCTION = %E_POINTER :
EXIT FUNCTION
|
Page last updated on Tuesday, 16 May 2006 02:11:47 +0200