草庐IT

android - 相机拍摄图像后,Phonegap 应用程序退出。 [安卓]

Phonegap1.4.1出现错误。我创建的phonegap应用在我拍照后返回应用后重启。这是我正在使用的代码:functioncapturePhoto(){//Takepictureusingdevicecameraandretrieveimageasbase64-encodedstringnavigator.camera.getPicture(onPhotoURISuccess,onFail,{quality:50,destinationType:Camera.DestinationType.FILE_URI});}functiononPhotoURISuccess(imageUR

java - MediaStore.EXTRA_OUTPUT 呈现数据为空,其他保存照片的方式?

Google提供了这种通过Intent拍照的通用代码:@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.main);//createIntenttotakeapictureandreturncontroltothecallingapplicationIntentintent=newIntent(MediaStore.ACTION_IMAGE_CAPTURE);fileUri=getOutputMediaFileU

java - MediaStore.EXTRA_OUTPUT 呈现数据为空,其他保存照片的方式?

Google提供了这种通过Intent拍照的通用代码:@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.main);//createIntenttotakeapictureandreturncontroltothecallingapplicationIntentintent=newIntent(MediaStore.ACTION_IMAGE_CAPTURE);fileUri=getOutputMediaFileU

Android:纵向模式下的相机预览方向

我使用相机仅显示预览(不拍照或录制视频)。应用始终处于纵向模式(横向模式已禁用)。相机预览总是逆时针旋转90度,我无法更改它(无论是setDisplayOrientation还是p.set("orientation","portrait")和p.set("rotation",90)).预览总是像这样旋转还是取决于设备?如果在纵向模式下总是这样,我可以在之后旋转图像。或者有没有办法正确设置相机?我已经阅读了很多关于此的主题,但没有任何答案对我有用(Galaxys2,Androidv2.3) 最佳答案 强制纵向:在您的AndroidMa

Android:纵向模式下的相机预览方向

我使用相机仅显示预览(不拍照或录制视频)。应用始终处于纵向模式(横向模式已禁用)。相机预览总是逆时针旋转90度,我无法更改它(无论是setDisplayOrientation还是p.set("orientation","portrait")和p.set("rotation",90)).预览总是像这样旋转还是取决于设备?如果在纵向模式下总是这样,我可以在之后旋转图像。或者有没有办法正确设置相机?我已经阅读了很多关于此的主题,但没有任何答案对我有用(Galaxys2,Androidv2.3) 最佳答案 强制纵向:在您的AndroidMa

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)