Share via


Imagelist.add Method

Adds a new image to the image list.

Syntax

public int add(Image image)

Run On

Client

Parameters

  • image
    Type: Image Class
    The new image to add to the list.

Return Value

Type: int
0 indicates success; otherwise, failure.

Remarks

You can use the autoResize method to automatically resize images when you add them to the list.

Examples

The following example creates a new image list and adds 3 images to the list.

ImageList list = new Imagelist( 
    Imagelist::smallIconWidth(), 
    Imagelist::smallIconHeight()); 
 
list.add(new Image(3104)); 
list.add(new Image(1097)); 
list.add(new Image(1200)); 
  
// Prints 3 
print list.count(); 
pause;

See Also

Reference

Imagelist Class