Issue
I'm new to Android, and I would like to know how to draw this blue shape:
Without using images, of course.
Thanks!
Solution
The easy way would be your suggested solution, ie. drawing all circles with no alpha to a bitmap, then draw that bitmap to another one using the desired alpha. The hard way would be using blend modes, specifically PorterDuff.Mode in Android. An example can be found here.
Also Check this http://softwyer.wordpress.com/2012/01/21/1009/
An example
Bitmap bitmap = Bitmap.createBitmap(b.getWidth(), b.getHeight(), b.getConfig());
Canvas canvas = new Canvas(bitmap);
Paint p = new Paint(Paint.ANTI_ALIAS_FLAG);
p.setColor(Color.BLACK);
canvas.drawRoundRect(new RectF(0, 0, b.getWidth(), b.getHeight()), borderRadius, borderRadius, p);
p.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
canvas.drawBitmap(b, 0, 0, p);
Answered By - S M
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.