Best way to add Drop Shadows to Variably Sized Images
As there isn't a drop shadow property for images (or is there?) does anybody have suggestions on best approach for this?
4 Answers
-
Assuming the images are rectangular, and that you have a way to obtain the image dimensions, you can draw an same sized empty view with a suitable shadow color and offset the position (e.g., left-5, top-5) and then display the image on top of that.
-
Good idea, but would that allow for any blurring of the shadow? I think what you're suggesting would just give me a hard edged shadow with transparency - which may be better than nothing.
Wishing there were CSS-like attributes where I could say something like:
box-shadow:2px, 2px, 2px, #000;
-
See Drop Shadow Text in Appcelerator Titanium on how you can use a
webView
and thetext-shadow
css directive to add a proper blurred drop shadow effect; I suppose that you might use a similar approach to embed html content that leverages real CSS attributes. -
Here's a really good widget