Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,2 @@
FillArea(0,0,-1,$ff)
; Fills an Area in red

View file

@ -0,0 +1,30 @@
Procedure Floodfill(x,y,new_color)
old_color = Point(x,y)
NewList stack.POINT()
AddElement(stack()):stack()\x = x : stack()\y = y
While(LastElement(stack()))
x = stack()\x : y = stack()\y
DeleteElement(stack())
If Point(x,y) = old_color
Plot(x, y, new_color)
AddElement(stack()):stack()\x = x : stack()\y = y +1
AddElement(stack()):stack()\x = x : stack()\y = y -1
AddElement(stack()):stack()\x = x +1 : stack()\y = y
AddElement(stack()):stack()\x = x -1 : stack()\y = y
EndIf
Wend
EndProcedure
If OpenWindow(0, 0, 0, 200, 200, "Floodfill Beispiel", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StartDrawing(WindowOutput(0))
Box(0, 0, 200, 200, RGB(255, 255, 255))
DrawingMode(#PB_2DDrawing_Outlined )
Circle(100, 100, 90, RGB(255 ,0,0)): Circle(120, 80, 30, RGB(255 ,0,0)): Circle(200,200, 70, RGB(255 ,0,0))
Floodfill(40,40,RGB(0 ,255,0))
StopDrawing()
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf