android bitmap gradient in android 2.1 -


is there way put gradient bitmap object in android 2.1? image must this:

image gradient

i need gradient on top of bitmap. drawablegradient or lineargradient android 2.2 these objects doesn't me @ all. thanks

do need xml or code? in code, try this:

    /* create 200 x 200 bitmap , fill black. */     bitmap b = bitmap.createbitmap(200, 200, config.argb_8888);     canvas c = new canvas(b);     c.drawcolor(color.black);      /* create gradient. */     lineargradient grad = new lineargradient(0, 0, 0, 50, color.gray, color.black, tilemode.clamp);      /* draw gradient top of bitmap. */     paint p = new paint();     p.setstyle(style.fill);     p.setshader(grad);     c.drawrect(0, 0, 200, 50, p); 

in xml, make 2 separate views in vertical linear layout. top view should have gradient drawable background, bottom, taller view should have solid background.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -