CreateShadowBrush -- make shadow brush from brush (V5.0)
[id] = CreateShadowBrush(id, src, color[, size])
This command creates a drop shadow from the brush specified in src and copies that shadow to a new brush that is specified in id. If id is set to Nil, CreateShadowBrush() will automatically choose an identifier and return it to you. If id is not Nil, there will be no return value. The color argument must be set to the color that the shadow shall be drawn in. In most cases this will be a plain #BLACK but combined with a transparency value because opaque shadows do not look very good. You can use the ARGB() function to combine a color and a transparency value into an ARGB color. Finally, the optional argument size can be used to specify the drop shadow's size.

Note that the size argument does not specify absolute width or height values but a relative factor by which the source brush will be grown on each side. This means that the drop shadow brush's width will be the source brush's width plus two times size, and the same applies to the drop shadow's height.

identifier for the new drop shadow brush function or Nil forauto id selection
the brush to convert into a shadow
desired shadow color as an ARGB value
optional: desired shadow size (defaults to 5)
optional: identifier of the drop shadow brush; will only be returned when you pass Nil as argument 1 (see above)
shadowsize = 20
CreateBrush(1, 320, 240, #RED)
CreateShadowBrush(2, 1, ARGB(40, #BLACK), shadowsize)
DisplayBrush(2, 0, 0)
DisplayBrush(1, shadowsize, shadowsize)
The code above creates a drop shadow for a 320x240 red rectangle and displays it beneath it.

Show TOC