如何在Android中创建循环图像视图?
ImageView
Bitmap circleBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); BitmapShader shader = new BitmapShader (bitmap, TileMode.CLAMP, TileMode.CLAMP);Paint paint = new Paint(); paint.setShader(shader);Canvas c = new Canvas(circleBitmap); c.drawCircle(bitmap.getWidth()/2, bitmap.getHeight()/2, bitmap.getWidth()/2, paint);imageView.setImageBitmap(circleBitmap);
相关分类