How do I clear Shadowbrush

I find that shadowbrush does a nice job of adding a shadow to text, but I have run into a problem. I cannot find a command that clears further shadowbrushing. When I am working on a global buffer, it will not due to create a new buffer in the middle of the work process, nor do I want to write the buffer to the canvas and create a new one.

I have found a workaround as shown below: = new shadowbrush = shadblur = shadcolor = xoffset = yoffset s0,xc,yc = 0 = 0

But that is not optimal because the shadowbrushing continues for all future drawing even though it cannot be seen. It slows things down.

So my question is, how do I clear the shadowbrush? What I seek is something like = off.

i think you need assign Nil
the meaning of Null = no object = Nil
at the end of the sequence turns it off.

Thanks Markus!

1 Like

The code above holds 5 errors (shadblur, shadcolor, zoffset and yoffset); I commented these 5 lines, and add: = Nil

after these lines, run, and click in the Button I put the code in.

No error was reported / crash, nothing.

Latest Xojo / macOS (Big Sur) / M1.

Thanks Emile, = Nil

was indeed the solution.

Don‘t forget you can also use Graphics.RestoreState to revert any changes of the graphics object you made since Graphics.SaveState.

1 Like