public MagnifierView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
bitmap = ((BitmapDrawable) getResources().getDrawable(R.drawable.pic)).getBitmap();
scaledBitmap = Bitmap.createScaledBitmap(bitmap, bitmap.getWidth() * FACTOR, bitmap.getHeight() * FACTOR,
true);
// bitmap.recycle();
mBitmapShader = new BitmapShader(scaledBitmap,
Shader.TileMode.CLAMP,
Shader.TileMode.CLAMP);
mShapeDrawable = new ShapeDrawable(new OvalShape());
mShapeDrawable.setBounds(0, 0, WIDTH, WIDTH);
mShapeDrawable.getPaint().setShader(mBitmapShader);
mMatrix = new Matrix();
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mPaint.setColor(Color.RED);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeWidth(3);
}
MagnifierView.java 文件源码
java
阅读 31
收藏 0
点赞 0
评论 0
项目:AndroidDigIn
作者:
评论列表
文章目录