I’ve seen the question come up many times over the years, and I think I finally have a pretty fast native solution that looks very nice.
This code could use some nil checking and could be modified to allow offsets etc, but here it is. (looks best to me at radius=50)
I might change it to “walk back” from the right and bottom edges to avoid artifacts, but I think it’s pretty good as is.
Enjoy!
[code]Private Function AddShadow(p As Picture,radius As integer) As Picture
dim pic As new Picture(p.Width+radius,p.Height+radius)
dim pg As Graphics=pic.Graphics
pg.ForeColor=&c000000fd
for x as integer=0 to p.width step 4
for y as integer=0 to p.height step 4
if xp.width-radius or yp.height-radius then pg.fillOval x,y,radius,radius
next
next
pg.ClearRect (pg.Width-p.width)/2,radius/3,p.width,p.height
pg.DrawPicture p,(pg.Width-p.width)/2,radius/3
Return pic
End Function
[/code]