Hi,

everything looks ok except the statement in the panel definition of map:

bmap = map;

Because you are assigning a bitmap pointer that has the same name as the panel.

Change this as first try.