WindowsOutput(#win) do not offer. It is canvas to be displayed in a certain window!
Code: Select all
If StartDrawing(CanvasOutput(canvas))
Box(10,10,200,200,#Black)
DrawText(25, 20, "Test canvas", #white, #black)
StopDrawing()
Code: Select all
If StartDrawing(CanvasOutput(canvas))
Box(10,10,200,200,#Black)
DrawText(25, 20, "Test canvas", #white, #black)
StopDrawing()
Code: Select all
OpenWindow(?,?,?,?,?,"",flags)
Canvas = CanvasGadget(#PB_Any,0,0,220,220)
If StartDrawing(CanvasOutput(canvas))
DrawingMode(#PB_2DDrawing_Transparent)
Box(10,10,200,200,#Black)
DrawText(25, 20, "Test canvas", #white, #black)
StopDrawing()
endif
Code: Select all
#window_1=10
#window_2=11
#canvas_1=12
OpenWindow(#WINDOW_1,0,0,250,250, "window 1", #PB_Window_WindowCentered)
OpenWindow(#WINDOW_2,300,300,250,250, "window 2", #PB_Window_WindowCentered)
CanvasGadget(#canvas_1, 0, 50,50 , 24)
Repeat
Event_CS = WaitWindowEvent()
If StartDrawing(CanvasOutput(#canvas_1))
Box(50,50,100,200,#Black)
DrawText(35, 30, "Test canvas", #Red, #Yellow)
StopDrawing()
EndIf
Until Event_CS = #PB_Event_CloseWindow