基于android 人脸识别 class MyImageView extends ImageView { private Bitmap mBitmap; private Canvas mCanvas; private int mBitmapWidth = 200; private int mBitmapHeight = 200; private Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); private int mDisplayStyle = 0; private int [] mPX = null; private int [] mPY = null; public MyImageView(Context c) { super(c); init(); } public MyImageView(Context c, AttributeSet attrs) { super(c, attrs); init(); } private void init() { mBitmap = Bitmap.createBitmap(mBitmapWidth, mBitmapHeight, Bitmap.Config.RGB_565); mCanvas = new Canvas(mBitmap); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setColor(0x80ff0000); mPaint.setStrokeWidth(3); } public Bitmap getBitmap() { return mBitmap; } @Override public void setImageBitmap(Bitmap bm) { if (bm != null) { mBitmapWidth = bm.getWidth(); mBitmapHeight = bm.getHeight(); mBitmap = Bitmap.createBitmap(mBitmapWidth, mBitmapHeight, Bitmap.Config.RGB_565); mCanvas = new Canvas(); mCanvas.setBitmap(mBitmap); mCanvas.drawBitmap(bm, 0, 0, null); } super.setImageBitmap(bm); } .....这只是部分代码,有兴趣的朋友下来看看
- 1
- zhao10010030402013-03-27骗人呢吗?都是错误
- weixiaofeihotmail2013-07-04用不了啊。浪费积分
- lishaman2013-04-19一般般 吧 真是的
- sopra_hs2013-08-02用不了,浪费
- cocoulong2013-04-27必须在手机上才能运行吧,目前还编译不过
- 粉丝: 1
- 资源: 10
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助