因为记性不好,随笔写了写
1.alpha通道0-255 之间
数值
0表示完全透明
255标识
透明
2.画椭圆或者圆
private Bitmap createOvalBitmap(int w, int h, boolean oval) { Bitmap bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); Paint paint = new Paint(); paint.setColor(0xFFFFCC44); paint.setAntiAlias(true); RectF r; if (!oval) { r = new RectF(0, 0, w, h); } else { r = new RectF(0, 0, w/2 , h * 3 / 4);//定义了椭圆所画的区域,宽高决定了椭圆大小,不用考虑角度问题 } canvas.drawOval(r, paint); return bitmap; }