/**
*
*/
package com.example.cirledrawimage;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Shader.TileMode;
import android.graphics.drawable.Drawable;
public class CirleDrawImage extends Drawable {
private Paint mPaint;
private int mWitdh;
private Bitmap mBimap;
public CirleDrawImage(Bitmap bitmap){
this.mBimap=bitmap;
BitmapShader bitmapShader=new BitmapShader(mBimap, TileMode.CLAMP, TileMode.CLAMP);
mPaint=new Paint();
mPaint.setAntiAlias(true);
mPaint.setShader(bitmapShader);
mWitdh=Math.min(mBimap.getWidth(), mBimap.getHeight());
}
@Overr
CirleDrawImage圆角图片
最新推荐文章于 2023-04-22 23:28:26 发布