 |
Syntax
Box(x, y, Width, Height [, Color])
Description
Draw a filled box of given dimensions on the current output. If the 'Color' parameter is
not specified, the default color set with FrontColor() will be used. RGB() can be used
to get a valid color value. The current output is set with StartDrawing().
Example:
; Several boxes with random colors
Width=200
Height=150
If OpenWindow(0, 0, 0, Width, Height, #PB_Window_SystemMenu|#PB_Window_ScreenCentered, "Boxes")
If StartDrawing(WindowOutput())
y = 0
#StepX = 10
StepY = Round(#StepX*Height/Width, 0)
For x = 0 To Width/2-5 Step #StepX
Box(x, y, Width-2*x, Height-2*y ,RGB(Random(255),Random(255),Random(255)))
y + StepY ; the same as y = y + StepY
Next x
StopDrawing() ; This is absolutely needed when the drawing operations are finished !!! Never forget it !
EndIf
Repeat : EventID = WaitWindowEvent() : Until EventID = #PB_Event_CloseWindow
EndIf

Supported OS Windows, Linux, AmigaOS <- BackColor() - 2DDrawing Index - Circle() ->
|
|
 |