I move a picture in a canvas with a scrollbar. It worked for years but it is not working anymore for a few months.
I don’t understand why, here are the code I am using.
in the paint event of the canvas:
if pp<>nil Then
g.DrawPicture pp,0,0,pp.Width-ScrollBar2.Value,pp.Height-ScrollBar1.Value,ScrollBar2.Value,ScrollBar1.Value
else
g.DrawString "Nil",10,50
end if
in the open event of the scrollbar : p=new picture(1000*defE,250*defE,0)
me.Maximum=p.width-Pcao.width
in the value changed event of the scrollbar : self.Refresh
I guess when changing from carbon to cocoa something has changed, maybe somebody can explain what?
Sorry for the picture
I don’t know how to show it
The canvas is set to erasebackground = true
and yes for the second question.
I am drawing with an object2d which I append to my picture pp and then canvas.backdrop=pp, see code below
is it a problem?