How to achieve expected output through Android bitmap? -


i using bitmap transformation add imageand text on image. per code getting blurred image:

enter image description here

what expecting this:

enter image description here

my bitmap transformation code follow:

 bitmap resultbitmap = bitmap.copy(bitmap.getconfig(), true);  bitmap bitmapimage =   bitmapfactory.decoderesource(context.getresources(), r.drawable.ic_heart);  bitmapimage = bitmap.createscaledbitmap(bitmapimage, 90, 90, true);   canvas canvas = new canvas(resultbitmap);  paint paint = new paint();  paint.setcolor(color.black);  paint.setstyle(paint.style.fill);  paint rectpaint = new paint();  rectpaint.setantialias(true);  rectpaint.setcolor(color.white);  rectpaint.setstyle(paint.style.fill);  rectpaint.settextsize(40);  rectpaint.setalpha(400);  paint.setalpha(150);  canvas.drawtext("$250", 20, 400, rectpaint);  canvas.drawbitmap(bitmapimage, 550, 55, null);  canvas.drawrect(0, 350, 140, 420, paint);   bitmap.recycle();  return resultbitmap; 

what doing wrong here? tried every possible getting fade :( can achieve putting black transparent image in background add text on or can achieve 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 -