本文主要是介绍自定义生成圆点的bitmap,纯色圆点,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
/*** 创造圆点,bool 是否异常*/ private Bitmap createBitmapPoint(String color) {Bitmap pointbmp = Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888);final Canvas canvas = new Canvas(pointbmp);final Paint paint = new Paint();final Rect rect = new Rect(0, 0, pointbmp.getWidth(), pointbmp.getHeight());final RectF rectF = new RectF(rect);paint.setAntiAlias(true);paint.setColor(Color.parseColor(color));canvas.drawARGB(0, 0, 0, 0);//设置画布背景透明canvas.drawOval(rectF, paint);//绘制圆点至Bitmapreturn pointbmp; }
这篇关于自定义生成圆点的bitmap,纯色圆点的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!