I'm trying to create an image off screen so it can be displayed later.
The image is called 'store'.
I think this is how you do it, but it's not working as I expect.
If anyone wouldn't mind having a look at this code and tell me where I'm going wrong I'd be very grateful. Thanks!
;--------------------- code -------------------------
width=200
height=128
store=CreateImage(0, Width, Height)
Gosub dothewindow:
OpenWindow(store, 100, 100, Width, Height,#PB_Window_SystemMenu, Str(store))
Repeat
If WindowEvent() = #PB_EventCloseWindow
quit =1
EndIf
Until quit =1
End
;--------------------------- subroutine---------------------
dothewindow:
StartDrawing(0) ;<-- I want this to draw to store
; if i use StartDrawing(store) it causes a crash
For x = 0 To 100
boxx=Random(200)
boxy=Random(128)
r=Random(255)
g=Random(255)
b=Random(255)
size=5+Random(25)
Circle(boxx,boxy,size,RGB(r,g,b)) ; a nice random circle...
Next x
StopDrawing()
Return
