imageList = new ImageList (); imageList.setBackground (getBackgroundPixel ()); imageList.add (image);
Rectangle bounds = image.getBounds (); imageList = getDisplay ().getImageList (new Point (bounds.width, bounds.height)); int index = imageList.indexOf (image); if (index == -1) index = imageList.add (image);
int imageIndex (Image image) {	if (image == null) return OS.I_IMAGENONE;	if (imageList == null) {		int hOldList = OS.SendMessage (handle, OS.TVM_GETIMAGELIST, OS.TVSIL_NORMAL, 0);		if (hOldList != 0) OS.ImageList_Destroy (hOldList);		imageList = new ImageList ();		imageList.setBackground (getBackgroundPixel ());		imageList.add (image);		int hImageList = imageList.getHandle ();		OS.SendMessage (handle, OS.TVM_SETIMAGELIST, OS.TVSIL_NORMAL, hImageList);		return 0;	}	int index = imageList.indexOf (image);	if (index != -1) return index;	return imageList.add (image);}