That bitmap id is valid. If you're getting a -13 error from SetCtrlBitmap, that is because of what you're passing as the control parameter of SetCtrlBitmap. It must be a control valid for that panel.
Remember, a bitmap is not a control. It is something that you can pass to a control, but it is not a control in and of itself.
When you no longer need the bitmap, you shouls discard it, using DiscardBitmap.
- luis