Drawing drop shadow behind non-square components

hi everyone,

I have some components I'm trying to draw a drop shadow behind. Currently I'm doing this by painting the shadows inside the components using a DropShadow object owned by each component. So I basically have a component with a background that is made up of a rounded rectangle with a shadow behind it. This looks fine, however if I try to animate the components things get really sluggish. 

I've tried using the DropShadower, which adds a shadow to the outside of the component. This seems like its a better solution as its only painting around the component and not trying to shadow everything behind it. It's also easier to use because I don't have to alter the layout of my components to accommodate an extra margin for the shadow. However this does not work in my case, because it seems to only be able to draw a square-edged shadow, and as mentioned my components have a slightly rounded look.  

Can anyone suggest a better way to do this that looks good but won't bog everything down by trying to paint a huge shadow behind my component that nobody sees anyway?

thanks!

nick

 

 

1 Like