ImageList::ImageCollection::AddStrip Method (Image^)

 

Adds an image strip for the specified image to the ImageList.

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

public:
int AddStrip(
	Image^ value
)

Parameters

value
Type: System.Drawing::Image^

A Bitmap with the images to add.

Return Value

Type: System::Int32

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

Exception Condition
ArgumentException

The image being added is null.

-or-

The image being added is not a Bitmap.

InvalidOperationException

The image cannot be added.

-or-

The width of image strip being added is 0, or the width is not equal to the existing image width.

-or-

The image strip height is not equal to existing image height.

The number of images to add is inferred from the width of the given image.

A strip is a single image that is treated as multiple images arranged side-by-side.

The following example demonstrates how to use AddStrip. To run this example, paste the following code into a Windows Form that contains an ImageList named imageList1 and a button and call the AddStripToCollection method in this example when handling the button's Click event.

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

.NET Framework
Available since 1.1
Return to top
Show: