Thanks for the explanation and the fast responses.
Currently I see no way to integrate ScrollingCanvas. My canvas has a list of objects that know how to draw themselves. My paint event simply calls a draw method that in turn (1) creates a BitMapForCaching to draw on, and (2) calls each objects draw method, and in the end the picture in BitMapForCaching is drawn on the canvas with DrawPicture:
[code]Private Sub draw(g As Graphics, printing as boolean = false, alternateX as integer = 0, alternateY as integer = 0)
// Create BitMapForCaching
mCachedContent = Self.TrueWindow.BitmapForCaching( hScroll.Maximum, vScroll.Maximum )
// Draw background and border.
g.transparency = 0
g.foreColor = &cFFFFFF // White
g.fillRect(0, 0, g.width, g.height)
dim x, y as integer
if alternateX < 0 then x = -alternateX
if alternateY < 0 then y = -alternateY
// MyDrawing is a list of objects that each know how to draw themselves
// Draw the picture by calling each objects draw method
if myDrawing <> nil then
dim objectNum as integer
for i as integer = 0 to objectList.ubound
objectNum = objectList(i)
dim selected as boolean = (selection = objectNum)
dim drawob as sdObjectType = myDrawing.lookup(objectNum, nil)
if drawob <> nil then drawob.draw(g, x, y, ZoomFactor, selected)
next i
end if // myDrawing = nil
// now draw the picture
g.DrawPicture(mCachedContent, 0, 0)
End Sub[/code]
I tried to change the mCachedContent reference
//mCachedContent = Self.TrueWindow.BitmapForCaching( hScroll.Maximum, vScroll.Maximum )
mCachedContent = pictCanvas.ScrollingImage
but no luck there.
I presume ScrollingCanvas does its own BitMapForCaching so that could be a problem, but at the moment I simply don’t know, and the documentation is not exactly helpful (I would rate it even less helpful than Monkeybread’s documentation). At the moment I would say ScrollingCanvas works very very well for what it does, support is superb, but the documentation is atrocious - as soon as you hit a snag it won’t be helpful. But keep in mind that this might be due to my very limited understanding of the product
which of course I blame entirely on the documentation