android-camera

looking for camera auto-focus indicator example [closed]

依然范特西╮ 提交于 2019-12-19 04:07:58
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am building a custom camera with auto focus, and was merely wondering if there is a way to invoke the same auto-focus rectangular indicator that the native camera has or if i have to build that from scratch.. any examples or tutorial links would be greatly appreciated. 回答1: It might be helpful to look at the

Picture taken from camera or gallery when using in imageview its orientation getting changed, and sometimes vertically stretched in Android

我们两清 提交于 2019-12-19 02:42:16
问题 In my application I have to capture image from camera or import from gallery, show it in imageview in activity. Everything is fine, I am getting image from both and able to set it on imageview without any exception. But sometimes image is not getting scaled properly and gets vertically stretched or with orientation changed. Please help me out. Here is my code to decode image referred from official android documentation: public static Bitmap decodeSampledBitmapFromResource(File photoFile, int

Android Camera setDisplayOrientation does not work

旧时模样 提交于 2019-12-19 02:04:22
问题 i am working camera project in android.my problem is camera setDisplayOrientation method is not working and my camera preview on surface always landscape.i want to expected portrait camera preview on SurfaceView. I am using Samsung galaxy y (Android 2.3.5) and my activity code shown below: import java.io.IOException; import android.app.Activity; import android.graphics.PixelFormat; import android.hardware.Camera; import android.os.Bundle; import android.view.SurfaceHolder; import android.view

What format is for Android camera with raw pictureCallback?

你离开我真会死。 提交于 2019-12-18 19:40:18
问题 I am trying to use data from Android picture. I do not like JPEG format, since eventually I will use gray scale data. YUV format is fine with me, since the first half part is gray-scale. from the Android development tutorial, public final void takePicture (Camera.ShutterCallback shutter, Camera.PictureCallback raw, Camera.PictureCallback postview, Camera.PictureCallback jpeg) Added in API level 5 Triggers an asynchronous image capture. The camera service will initiate a series of callbacks to

Getting Uri Null in capture photo from camera intent in samsung mobile

徘徊边缘 提交于 2019-12-18 17:56:13
问题 I am getting null in contenturi in samsung phones while capturing photo from camera but rest of others phones its working fine. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); try { if (requestCode == IMAGE_CAPTURE) { if (resultCode == RESULT_OK){ Uri contentUri = data.getData(); if(contentUri!=null) { String[] proj = { MediaStore.Images.Media.DATA }; Cursor cursor = managedQuery(contentUri, proj,

Getting Uri Null in capture photo from camera intent in samsung mobile

南笙酒味 提交于 2019-12-18 17:56:03
问题 I am getting null in contenturi in samsung phones while capturing photo from camera but rest of others phones its working fine. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); try { if (requestCode == IMAGE_CAPTURE) { if (resultCode == RESULT_OK){ Uri contentUri = data.getData(); if(contentUri!=null) { String[] proj = { MediaStore.Images.Media.DATA }; Cursor cursor = managedQuery(contentUri, proj,

access both front and back camera simultaneously on samsung galaxy devices

冷暖自知 提交于 2019-12-18 16:48:23
问题 I know this question has been asked before but its been a long time. Asking this question again to gather any new hacks/thoughts/approaches. I need to access both front and back camera simultaneously. So far I have tried implementations using android camera API (Dual Camera- by Jens) and camera2 API. Both implementations work fine on devices having hardware support(Dual Image Signal Processors) for dual camera feature.I have tested and both implementations works fine on HTC one M8(Snapdragon

setPreviewFpsRange not working despite values being within getPreviewFpsRange's range

限于喜欢 提交于 2019-12-18 13:37:47
问题 This simple code: Camera.Parameters params = currentCamera.getParameters(); params.setPreviewFpsRange( 10000, 15000 ); currentCamera.setParameters( params ); does not work on my Nexus 4 (or my Motorola Atrix), despite the allowed values being between in the allowed range of 5000 to 120000. When I try to use any min or max values different than 5000 and 120000, respectively, I get: setPreviewFpsRange(const android::QCameraParameters&): error: FPS range value not supported which is silly. Also,

Android camera , onPictureTaken(byte[] imgData, Camera camera) method & PictureCallback never called

▼魔方 西西 提交于 2019-12-18 12:47:14
问题 I have a custom camera app , that previews the camera video output on SurfaceView and attempts to take pictures , the pics should be will be processed by “xzing “scanner API to decode any barcodes in the image. My app previews correctly and does not throw any errors or expectations, however my onPictureTaken(byte[] imgData, Camera camera) method & PictureCallback are never called, therefore I’m unable to get the image & continue with further scanning. Below is the actual code for activity

Take photo w/ camera intent and display in imageView or textView?

落花浮王杯 提交于 2019-12-18 12:31:26
问题 I have a question about how to take an image using the camera intent (or camera API) and then bring the image into an imageView for me to display in my application. This is what I have so far. I setup a button Button btnPicture = (Button) findViewById(R.id.btn_picture); btnPicture.setOnClickListener(this); I setup a Camera method private void Camera() { Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, TAKE_PICTURE_CODE); intent