Name
CreateShadowBrush -- make shadow brush from brush (V5.0)
Synopsis
[id] = CreateShadowBrush(id, src, color[, size])
Function
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 that is vacant 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.

Inputs
id
identifier for the new drop shadow brush function or Nil forauto id selection
src
the brush to convert into a shadow
color
desired shadow color as an ARGB value
size
optional: desired shadow size (defaults to 5)
Results
id
optional: identifier of the drop shadow brush; will only be returned when you pass Nil as argument 1 (see above)
Example
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