#PB_2DDrawing_XOr problem
Posted: Fri Jan 23, 2026 12:55 am
Ver: 6.30
#PB_2DDrawing_XOr drawing on Windowoutput
Xor function seems to work, colors however are all reset to black !!!!!
#PB_2DDrawing_XOr drawing on Windowoutput
Xor function seems to work, colors however are all reset to black !!!!!
Code: Select all
If OpenWindow(0, 0, 0, 200, 200, "2DDrawing Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
;If CreateImage(0, 200, 200) And StartDrawing(ImageOutput(0))
If StartDrawing(WindowOutput(0))
DrawingMode(#PB_2DDrawing_Outlined |#PB_2DDrawing_XOr)
;DrawingMode(#PB_2DDrawing_Outlined)
y = 0
For x = 0 To 95 Step 10
FrontColor(RGB(Random(255), Random(255), Random(255)))
Box(x, y, 200-2*x, 200-2*y)
y + 10 ; the same as y = y + 10
Next x
StopDrawing()
;ImageGadget(0, 0, 0, 200, 200, ImageID(0))
EndIf
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf