public CircleDrawable(Bitmap bitmap, Integer strokeColor, float strokeWidth) {
this.radius = (float) (Math.min(bitmap.getWidth(), bitmap.getHeight()) / 2);
this.bitmapShader = new BitmapShader(bitmap, TileMode.CLAMP, TileMode.CLAMP);
this.mBitmapRect = new RectF(0.0f, 0.0f, (float) bitmap.getWidth(), (float) bitmap
.getHeight());
this.paint = new Paint();
this.paint.setAntiAlias(true);
this.paint.setShader(this.bitmapShader);
this.paint.setFilterBitmap(true);
this.paint.setDither(true);
if (strokeColor == null) {
this.strokePaint = null;
} else {
this.strokePaint = new Paint();
this.strokePaint.setStyle(Style.STROKE);
this.strokePaint.setColor(strokeColor.intValue());
this.strokePaint.setStrokeWidth(strokeWidth);
this.strokePaint.setAntiAlias(true);
}
this.strokeWidth = strokeWidth;
this.strokeRadius = this.radius - (strokeWidth / 2.0f);
}
CircleBitmapDisplayer.java 文件源码
java
阅读 40
收藏 0
点赞 0
评论 0
项目:boohee_v5.6
作者:
评论列表
文章目录