You can create an image at large scale as long as it fit in less than 2 GB.
Just disable debugger around canvas or image creation:
Code: Select all
#maxH=100000; Change size here
Procedure DrawSomething()
StartDrawing(CanvasOutput(2))
LineXY(0, 0, 800, #maxH, #Red)
StopDrawing()
EndProcedure
Procedure ClrSomething()
StartDrawing(CanvasOutput(2))
Box(0, 0, 800, #maxH, #White)
StopDrawing()
EndProcedure
OpenWindow(1, 10, 10, 1024, 758, "")
DisableDebugger
hScrollArea=ScrollAreaGadget(1, 0, 0, 824, WindowHeight(1), 800, #maxH)
hCanvas=CanvasGadget(2, 0, 0, 800, #maxH)
CloseGadgetList()
EnableDebugger
Debug hCanvas
Debug hScrollArea
If hCanvas
ButtonGadget(3, 900, 10, 48, 24, "Draw")
ButtonGadget(4, 900, 50, 48, 24, "Clear")
BindGadgetEvent(3, @DrawSomething())
BindGadgetEvent(4, @ClrSomething())
EndIf
Repeat
Event=WaitWindowEvent()
Until Event=#PB_Event_CloseWindow
The limiting factor here is the CanvasGadget.
It can't be larger than 32768 in either direction.
Be carefull at the upper end of canvas/image size.
The handle starts to be unreliable as indicator for a successful created canvas/image when it approches the maximum usable memory.