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

enter image description here

for can use translucent image desired gradient , put on top of image view in framelayout. capture bitmap of view.

gradient

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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -