Creating a New Picture

If I want to create a NEW Picture based on canvas dimensions where is the best place to do this? Canvas.open, Window.open… I have tried both but it is producing an error “Width/Height needs to be in the range 1-32767” and when I dig further canvas.width has a value but canvas.height is zero

buffpicture = New Picture(canvas1.Width,canvas1.Height,32)

Open is often too early.
I tend to add an ‘initialised’ property to windows.

In the activate event, I have

[code]if self.initialised then

else
mypic = new picture (canvas1.width,canvas1.height)
self.initialised = true
end if[/code]

But another approach is to ask 'when do you NEED this picture?
It may need to be a different size each time if the canvas is locked to the window size, and the window is resized…

I think this is on the right track Jeff. The canvas is resized in proportion as the window is resized

So, maybe set that in the Window Resizing Event (after some checkings)…

In which case maybe you initialize it in or as a result of Window.Resized.