Thanks for help!
Code: Select all
Procedure copyThis(w1,w2)
Protected img
StartDrawing(WindowOutput(w1))
img= GrabDrawingImage(#PB_Any,0,0,OutputWidth(),OutputHeight())
StopDrawing()
StartDrawing(WindowOutput(w2))
DrawImage(ImageID(img),0,0,OutputWidth(),OutputHeight())
StopDrawing()
FreeImage(img)
EndProcedure
Procedure draw(w1)
Static x=-100
StartDrawing(WindowOutput(c))
For p= 0 To 100
Box(0,0,OutputWidth(),OutputHeight(),$ffffff)
Circle(x,150,100,$0000ff)
x+1:If x>OutputWidth():x=-100:EndIf
DrawText(10,10,Str(x),$0,$ffffff)
Next p
StopDrawing()
EndProcedure
OpenWindow(0,0,0,400,300,"W1",#PB_Window_SystemMenu)
OpenWindow(1,500,0,400,300,"W2",#PB_Window_SystemMenu)
t= ElapsedMilliseconds()
For p= 1 To 100
; Repeat
event= WindowEvent()
If event= #PB_Event_CloseWindow
Break
EndIf
draw(0)
copyThis(0,1)
; Delay(1)
; ForEver
Next p
MessageRequester("Time", Str(ElapsedMilliseconds()-t) +" ms")

