Setting a clip region to a palette brush fails
Posted: Fri May 02, 2025 3:57 pm
I'm trying to find a work-around for some other palette issue, and found this one, which looks like a bug for me. I can't see any mentions in the documentation that SetClipRegion() shouldn't work when SelectBrush() is a palette brush.
Code: Select all
; Setting a clip region to an RGB brush works
CreateBrush(1, 400, 300)
SelectBrush(1)
CreateClipRegion(1, #BOX, 0, 0, 320, 240)
SetClipRegion(1)
Box(1, 1, 350, 250, #BLUE)
EndSelect()
DisplayBrush(1, 0, 0)
Wait(100)
Cls
; Setting a clip region to a palette brush doesn't work
CreateBrush(2, 400, 300, {Palette=#PALETTE_GRAY8})
SelectBrush(2)
CreateClipRegion(2, #BOX, 0, 0, 320, 240)
SetClipRegion(2) ; Wrong usage/parameters for this command! Why? Bug?
Box(1, 1, 350, 250, #BLUE)
EndSelect()
DisplayBrush(2, 0, 0)
WaitLeftMouse()