android - Creating a shadow around a canvas drawn shape? -


what steps required create shape e.g. rectangle shadow scratch using canvas?

adding shadow layer paint used draw rectangle yielded no success.

no need bitmap, needed set layer type layer_type_software original approach worked.

public class testshapeshadow extends view {     paint paint;      public testshapeshadow(context context)     {        super(context);            paint = new paint(paint.anti_alias_flag);         paint.setshadowlayer(12, 0, 0, color.yellow);          // important apis          setlayertype(layer_type_software, paint);     }      @override     protected void ondraw(canvas canvas)     {            canvas.drawrect(20, 20, 100, 100, paint);     } } 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -