How to achieve expected output through Android bitmap? -
i using bitmap
transformation add image
and text
on image. per code getting blurred image:
what expecting this:
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
Post a Comment