Export (0) Print
Expand All

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.

When to implement

Typically, you use the OLE-provided picture object, which provides the IPicture and IPictureDisp interfaces for you. The IPicture interface is the primary interface implemented by the OLE-provided picture object. It allows the caller to manage picture properties and to use that picture in graphical rendering.

When to use

Use this interface to change the properties of a picture object.

Members

The IPicture interface inherits from the IUnknown interface. IPicture also has these types of members:

Methods

The IPicture interface has these methods.

MethodDescription
get_Attributes

Retrieves the current set of the picture's bit attributes.

get_CurDC

Retrieves the current device context into which this picture is selected.

get_Handle

Retrieves a handle to the picture managed within this picture object.

get_Height

Retrieves the current height of the picture in the picture object.

get_hPal

Retrieves the current palette of the picture.

get_KeepOriginalFormat

Retrieves the current value of the picture object's KeepOriginalFormat property.

get_Type

Retrieves the current type of the picture.

get_Width

Retrieves the current width of the picture in the picture object.

PictureChanged

Notifies the picture object that its picture resource changed.

put_KeepOriginalFormat

Sets the picture object's KeepOriginalFormat property.

Render

Draws the specified portion of the picture onto the specified device context, positioned at the specified location.

SaveAsFile

Saves the picture's data into a stream in the same format that it would save itself into a file.

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 handle.

set_hPal

Sets the current palette of the picture.

 

Remarks

Each property in the IPicture interface includes a get_PropertyName method if the property supports read access and a put_PropertyName method if the property supports write access.

PropertyTypeAccessDescription
HandleOLE_HANDLE (int) RThe Windows GDI handle of the picture
hPalOLE_HANDLE (int) RWThe Windows handle of the palette used by the picture.
TypeshortRThe type of picture (see PICTYPE).
WidthOLE_XSIZE_HIMETRIC (long) RThe width of the picture.
HeightOLE_YSIZE_HIMETRIC (long) RThe height of the picture.
CurDCHDCRThe current device context.
KeepOriginalFormatBOOLRWIf TRUE, the picture object maintains the entire original state of the picture in memory. If FALSE, any state not applicable to the user's computer is discarded.
AttributesDWORDRMiscellaneous bit attributes of the picture.

 

OLE Implementation

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. A picture object is created with OleCreatePictureIndirect and supports both the IPicture and the IPictureDisp interfaces.

The OLE-provided picture object implements the complete semantics of the IPicture and IPictureDisp interfaces.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

OCIdl.h

IDL

OCIdl.idl

IID

IID_IPicture is defined as 7BF80980-BF32-101A-8BBB-00AA00300CAB

See also

IPictureDisp

 

 

Community Additions

ADD
Show:
© 2014 Microsoft