ImageList::ImageCollection::Add Method (Image^, Color)

 

Adds the specified image to the ImageList, using the specified color to generate the mask.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
int Add(
	Image^ value,
	Color transparentColor
)

Parameters

value
Type: System.Drawing::Image^

A Bitmap of the image to add to the list.

transparentColor
Type: System.Drawing::Color

The Color to mask this image.

Return Value

Type: System::Int32

The index of the newly added image, or -1 if the image cannot be added.

Exception Condition
ArgumentNullException

The image being added is null.

ArgumentException

The image being added is not a Bitmap.

.NET Framework
Available since 1.1
Return to top
Show: