草庐IT

CAMERA_WIDTH

全部标签

Android byte[] 到 Camera.onPreviewFrame 中的图像

当尝试使用BitmapFactory.decodeByteArray将Camera.onPreviewFrame的byte[]转换为Bitamp时给出我一个错误SkImageDecoder::Factory返回null以下是我的代码:publicvoidonPreviewFrame(byte[]data,Cameracamera){Bitmapbmp=BitmapFactory.decodeByteArray(data,0,data.length);} 最佳答案 这很难找到!但是从API8开始,在android.graphics中有

Android byte[] 到 Camera.onPreviewFrame 中的图像

当尝试使用BitmapFactory.decodeByteArray将Camera.onPreviewFrame的byte[]转换为Bitamp时给出我一个错误SkImageDecoder::Factory返回null以下是我的代码:publicvoidonPreviewFrame(byte[]data,Cameracamera){Bitmapbmp=BitmapFactory.decodeByteArray(data,0,data.length);} 最佳答案 这很难找到!但是从API8开始,在android.graphics中有

android - 撤销权限 android.permission.CAMERA

我得到错误revokedpermissionandroid.permission.CAMERA我在list上使用了相机权限privatevoiddispatchTakePictureIntent(intactionCode){IntenttakePictureIntent=newIntent(MediaStore.ACTION_IMAGE_CAPTURE);switch(actionCode){caseACTION_TAKE_PHOTO_B:Filef=null;try{f=setUpPhotoFile();mCurrentPhotoPath=f.getAbsolutePath();t

android - 撤销权限 android.permission.CAMERA

我得到错误revokedpermissionandroid.permission.CAMERA我在list上使用了相机权限privatevoiddispatchTakePictureIntent(intactionCode){IntenttakePictureIntent=newIntent(MediaStore.ACTION_IMAGE_CAPTURE);switch(actionCode){caseACTION_TAKE_PHOTO_B:Filef=null;try{f=setUpPhotoFile();mCurrentPhotoPath=f.getAbsolutePath();t

android - W/CameraBase:连接到相机 : 0 on camera. open() 调用时发生错误

我正在编写一个相机应用程序,每当我调用camera.open()时应用程序崩溃,然后我收到此错误:W/CameraBase﹕连接相机时出错:0这是我打开相机的方式:publicvoidgetCameraInstance(){mCamera=null;try{mCamera=Camera.open();//attempttogetaCamerainstance}catch(Exceptione){//Cameraisnotavailable(inuseordoesnotexist)}}更新:如果您正在阅读本文,请注意这是针对原始相机API的,不再适用最新版本的相机API(camera2)

android - W/CameraBase:连接到相机 : 0 on camera. open() 调用时发生错误

我正在编写一个相机应用程序,每当我调用camera.open()时应用程序崩溃,然后我收到此错误:W/CameraBase﹕连接相机时出错:0这是我打开相机的方式:publicvoidgetCameraInstance(){mCamera=null;try{mCamera=Camera.open();//attempttogetaCamerainstance}catch(Exceptione){//Cameraisnotavailable(inuseordoesnotexist)}}更新:如果您正在阅读本文,请注意这是针对原始相机API的,不再适用最新版本的相机API(camera2)

android - 自定义 View 的 onMeasure : how to get width based on height

我的问题之前的版本太罗嗦了。人们无法理解它,所以下面是一个完整的重写。如果您对旧版本感兴趣,请参阅edithistory。RelativeLayout的父级将MeasureSpecs发送到其subview的onMeasure方法,以查看child想要多大。这发生在几个channel中。我的自定义View我有一个customview。随着View内容的增加,View的高度也会增加。当View达到父级允许的最大高度时,任何其他内容的View宽度都会增加(只要为宽度选择了wrap_content)。因此,自定义View的宽度直接取决于父级所说的最大高度。(不和谐的)父子对话onMeasure

android - 自定义 View 的 onMeasure : how to get width based on height

我的问题之前的版本太罗嗦了。人们无法理解它,所以下面是一个完整的重写。如果您对旧版本感兴趣,请参阅edithistory。RelativeLayout的父级将MeasureSpecs发送到其subview的onMeasure方法,以查看child想要多大。这发生在几个channel中。我的自定义View我有一个customview。随着View内容的增加,View的高度也会增加。当View达到父级允许的最大高度时,任何其他内容的View宽度都会增加(只要为宽度选择了wrap_content)。因此,自定义View的宽度直接取决于父级所说的最大高度。(不和谐的)父子对话onMeasure

android - Camera2 API 中的 Camera.PreviewCallback 等效项

API21中的Camera2中的Camera.PreviewCallback是否有任何等效项,比映射到SurfaceTexture并拉取Bitmap更好?我需要能够将预览数据从相机中提取为YUV? 最佳答案 您可以从Google的Camera2Basic示例代码开始。您需要将ImageReader的表面作为目标添加到预览捕获请求中://setupaCaptureRequest.BuilderwiththeoutputSurfacemPreviewRequestBuilder=mCameraDevice.createCaptureRe

android - Camera2 API 中的 Camera.PreviewCallback 等效项

API21中的Camera2中的Camera.PreviewCallback是否有任何等效项,比映射到SurfaceTexture并拉取Bitmap更好?我需要能够将预览数据从相机中提取为YUV? 最佳答案 您可以从Google的Camera2Basic示例代码开始。您需要将ImageReader的表面作为目标添加到预览捕获请求中://setupaCaptureRequest.BuilderwiththeoutputSurfacemPreviewRequestBuilder=mCameraDevice.createCaptureRe