Let me explain why you are getting a new bitmap ID. When you get the bitmap from the table cell it creates a new copy of the bitmap for you to use in your code, so there is a new bitmap ID every time.
The best way to accomplish what you want to do is to use multiple data types of the table cells to include an integer ID with the bitmap. These integers could be reference numbers or the original bitmap ID.
So what you would do is this.
1) When you set the bitmap value into the cell, also set an integer value of the cell. Your code would be something like:
SetTableCellAttribute (panelHandle, PANEL_TABLE, cell,
ATTR_CELL_TYPE, VAL_CELL_PICTURE);
SetTableCellVal (panelHandle, PANEL_TABLE, cell, bitmapID);
SetTableCellAttribute (panelH
andle, PANEL_TABLE, cell,
ATTR_CELL_TYPE, VAL_CELL_NUMERIC);
SetTableCellVal (panelHandle, PANEL_TABLE, cell, bitmapID);
SetTableCellAttribute (panelHandle, PANEL_TABLE, cell,
ATTR_CELL_TYPE, VAL_CELL_PICTURE);
2) Then, when you want to see which bitmap is displayed, check the numeric value of the cell with:
SetTableCellAttribute (panelHandle, PANEL_TABLE, cell,
ATTR_CELL_TYPE, VAL_CELL_NUMERIC);
GetTableCellVal (panelHandle, PANEL_TABLE, cell, ¤tBMPID);
SetTableCellAttribute (panelHandle, PANEL_TABLE, cell,
ATTR_CELL_TYPE, VAL_CELL_PICTURE);
It will retain both the picture and integer data for the cell, so you can use the integer value to reference which bitmap is currently in the cell.
Best Regards,
Chris Matthews
National Instruments