[id] = CreateShadowBrush(id, src, color[, size])
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.
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.