Image.GetPropertyItem Method (Int32)


Gets the specified property item from this Image.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

member GetPropertyItem : 
        propid:int -> PropertyItem


Type: System.Int32

The ID of the property item to get.

Return Value

Type: System.Drawing.Imaging.PropertyItem

The PropertyItem this method gets.

Exception Condition

The image format of this image does not support property items.

For a list of property item IDs and links to more information, see Id.

It is difficult to set property items, because the PropertyItem class has no public constructors. One way to work around this restriction is to obtain a PropertyItem by retrieving the PropertyItems property value or calling the GetPropertyItem method of an Image that already has property items. Then you can set the fields of the PropertyItem and pass it to SetPropertyItem.

The following code example demonstrates how to use the GetPropertyItem and SetPropertyItem methods. This example calls GetPropertyItem passing an ID value. For a list of ID values see, Id. This example is designed to be used with Windows Forms. To run this example, paste it into a form, and handle the form's Paint event by calling the DemonstratePropertyItem method, passing e as PaintEventArgs.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top