This documentation is archived and is not being maintained.

Image.SetPropertyItem Method

Stores a property item (piece of metadata) in this Image object.

[Visual Basic]
Public Sub SetPropertyItem( _
   ByVal propitem As PropertyItem _
public void SetPropertyItem(
 PropertyItem propitem
public: void SetPropertyItem(
 PropertyItem* propitem
public function SetPropertyItem(
   propitem : PropertyItem


The PropertyItem to be stored.

Return Value

This method does not return a value.


If the image format does not support property items, this method throws System.ArgumentException with the message "Property not supported." If the image format supports property items but does not support the particular property you are attempting to set, this method ignores the attempt but does not throw an exception.

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 object by retrieving the PropertyItems property or calling the GetPropertyItem method of an Image object that already has property items. Then you can set the fields of the PropertyItem object and pass it to SetPropertyItem.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Image Class | Image Members | System.Drawing Namespace