标签:android os 使用 java sp 数据 问题 log 代码
问题描述public void run() { //获取屏幕信息 DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); int screenWidth = dm.widthPixels; int screenHeigh = dm.heightPixels; Log.i(tag, "------------进入DrawImage---------------"); Log.i(tag, "当前屏幕宽为:" + screenWidth + ", 当前屏幕高为: " + screenHeigh); Log.i(tag, "进入DrawImage USB摄像头当前状态为" + cameraExists); while (cameraExists) { // rect = new Rect(0, 0, screenWidth/2, screenHeigh/2); rectF = new RectF(0, 0, screenWidth, screenHeigh); //w和h分别是屏幕的宽和高,也就是你想让图片显示的宽和高 // Log.i(tag, "------------USB摄像头开始画图---------------"); if (bmp != null) { Canvas canvas = holder.lockCanvas(); if (canvas != null) { // canvas.drawBitmap(bmp, null, rect, null); canvas.drawBitmap(bmp, null, rectF, null); holder.unlockCanvasAndPost(canvas); } } } Log.i(tag, "线程退出DrawImage"); }解决方案1
Android中用Bitmap画图预览,视频图像分辨率是320x240(4:3),手机分辨率是540x960(9:16),图像被拉伸怎么办?
标签:android os 使用 java sp 数据 问题 log 代码
原文地址:http://www.cnblogs.com/meizhenfen42/p/4027492.html