brendan-duncan / image

Dart Image Library for opening, manipulating, and saving various different image file formats.
MIT License
1.17k stars 265 forks source link

add shadow to Text in drawString #644

Open nikhil-viewzen opened 5 months ago

nikhil-viewzen commented 5 months ago

Is it possible to add shadow to text in drawString

brendan-duncan commented 5 months ago

There is a dropShadow filter, but to use on text that's drawn on another image, you'll need to draw the text into it's own image, add the shadow to it, and then composite the result onto the other image.

https://github.com/brendan-duncan/image/blob/main/test/filter/drop_shadow_test.dart https://github.com/brendan-duncan/image/blob/main/doc/images/filter/dropShadow.png

Alternatively if you just want a hard shadow you could draw the text twice.