colors - How to add rainbow gradient to an Image in android -
i want add transparent rainbow or spectrum gradient bitmap
.
in photoshop
easy. want programmatically
. have gone through lot of research. gradient has 1 starting color
, 1 ending
. how add rainbow color(multiple color) gradient in android.
or there way add effect bitmap in android? given
for can use translucent image desired gradient , put on top of image view in framelayout
. capture bitmap of view.
once layout ready use this answer capture bitmap it
try convert view (framelayout) bitmap:
public bitmap viewtobitmap(view view) { bitmap bitmap = bitmap.createbitmap(view.getwidth(), view.getheight(), bitmap.config.argb_8888); canvas canvas = new canvas(bitmap); view.draw(canvas); return bitmap; }
Comments
Post a Comment