AddTreeImage
int AddTreeImage (int panelHandle, int controlID, int bitmapID);
Purpose
Adds an image to the tree control.
![]() |
Note LabWindows/CVI displays images in the tree control at 16 x 16 pixels, regardless of the original size of the image. |
Returns the zero-based index of the new image in the image list of the tree control. Use this index to set the ATTR_IMAGE_INDEX and ATTR_COLLAPSED_IMAGE_INDEX of an item or the ATTR_EXPANDED_IMAGE_INDEX and ATTR_COLLAPSED_IMAGE_INDEX of the tree.
You can obtain the ID of the bitmap object from functions such as NewBitmapEx and GetCtrlBitmap.
Supported Controls
You can use AddTreeImage with tree controls.
Parameters
Input | ||
Name | Type | Description |
panelHandle | int | Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel. |
controlID | int | The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by functions such as NewCtrl and DuplicateCtrl. |
bitmapID | int | ID of the bitmap object that contains the image. You can obtain the ID from functions such as NewBitmapEx and GetCtrlBitmap. |
Return Value
Name | Type | Description |
imageIndex | int | Returns the index of the new tree image. Use the index to specify the image index in subsequent function calls. Negative values indicate that an error occurred. |
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 7.0 and later
Example
Refer to userint\treeimage.cws for an example of using the AddTreeImage function.