Shadow Brush

I’m reading a lot about Shadow brush (what there is to read) but I don’t see how to set the parameters for blur and offset. The docs say they exist and I bet an experienced Xojo programmer can infer how to implement, but I’ve got no clue. I can create the rectangle (in a canvas control) but I don’t know where to put the actual shadow brush data. Just creating the brush doesn’t show anything outside the rectangle (to me on Win 10 Pro 64 on HD laptop screen using Xojo 2021 V1).

The question of how to see the shadow has been asked on this forum and the answer was to make the canvas bigger than the rectangle and that makes sense. Still, there is the question of where to put the brush parameters in code. I assume they must exist since they’re in the docs, but I see no implementation in the wild.

Thanks
fritz

Sample:

g.ShadowBrush = New ShadowBrush(2, 2, Color.Red, 3) ' x-Offset, y-Offset, Color, Blur Amount
g.DrawRectangle(10, 10, 100, 100)
g.ShadowBrush = Nil ' Reset Shadow
1 Like

Works like a charm, Mr. T.

If you’d edit your post to remove the typo on “NewShadownBrush” (ditch the unintended “N”), other noobs like myself can receive the benefit of your kind response.

With due appreciation,
fritz

1 Like