I have a panel pan as b4xview (defined in Globals) and a canvas can as b4xcanvas, defined in the sub
pan.color is in designer set to white
all happens in a drawing sub:
I start with canv.Initialize(pan)
it works fine, drawing one figure to the canvas.
If I draw the figure in a for next loop (calling the sub from the loop) in different positions and If I do not call
canv.ClearRect(canv.TargetRect)
then the figure is drawn one over another.
If I DO call canv.ClearRect(canv.TargetRect), the previous figure is deleted, but the background-color of the pan is gone. (Each figure is drawn solely)
If I instead of .ClearRect use canv.DrawRect(canv.TargetRect,colors.white,True,1) it works fine, but I wanna keep the pan.color, which could be other then white in other panels, and
canv.DrawRect(canv.TargetRect,pan.Color,True,1) seems not to work, because pan.color here is 0 which I do not understand.
Where am I wrong?
TH
pan.color is in designer set to white
all happens in a drawing sub:
I start with canv.Initialize(pan)
it works fine, drawing one figure to the canvas.
If I draw the figure in a for next loop (calling the sub from the loop) in different positions and If I do not call
canv.ClearRect(canv.TargetRect)
then the figure is drawn one over another.
If I DO call canv.ClearRect(canv.TargetRect), the previous figure is deleted, but the background-color of the pan is gone. (Each figure is drawn solely)
If I instead of .ClearRect use canv.DrawRect(canv.TargetRect,colors.white,True,1) it works fine, but I wanna keep the pan.color, which could be other then white in other panels, and
canv.DrawRect(canv.TargetRect,pan.Color,True,1) seems not to work, because pan.color here is 0 which I do not understand.
Where am I wrong?
TH