Warning: Undefined array key "HTTP_REFERER" in /home/u522501990/domains/makemeengr.com/public_html/wp-content/themes/generatepress/generatepress.theme#archive on line 43

Captured Photo orientation is changing in android

I had the same problem mostly with the Samsung handsets.Apparently Samsung phones set the EXIF orientation tag, rather than rotating individual pixels.Reading the Bitmap using BitmapFactory does not support this tag.What i found the solution to this problem was using ExifInterface in onActivityResult method of the activity.Which checks for orientation associated with URI of the … Read more

YUV to RGB conversion by fragment shader

I don’t know if you solved your problem. I used your code and I solved in this mode. public class MyRenderer implements Renderer{ public static final int recWidth = Costanti.recWidth; public static final int recHeight = Costanti.recHeight; private static final int U_INDEX = recWidth*recHeight; private static final int V_INDEX = recWidth*recHeight*5/4; private static final int … Read more

Camera in Android, how to get best size, preview size, picture size, view size, image distorted

Most often, but not always, there is correspondence between picture aspect ratios and preview aspect ratios. You can be assured that at least some of them are classic 4:3 ratios (e.g. 640×480). Support for 16:9 is also widely available. The screen may have different aspect ratio. To fill it with a camera image correctly, it … Read more

Android can’t record video with Front Facing Camera, MediaRecorder start failed: -19

I wrestled with this problem a bit today, too. First, make sure that your permissions are set up correctly. Specifically, to record video, you’ll want: <uses-feature android:name=”android.hardware.camera.front” /> <uses-feature android:name=”android.hardware.microphone”/> <uses-permission android:name=”android.permission.CAMERA” /> <uses-permission android:name=”android.permission.RECORD_AUDIO” /> <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE” /> Second, and this is the tricky part, this line from the tutorial does not work with … Read more

How to fix “Fail to connect to camera service” exception in Android emulator

From the Android Developers Docs: Calling Camera.open() throws an exception if the camera is already in use by another application, so we wrap it in a try block. Try wrapping that code in a try catch block like so: try { releaseCameraAndPreview(); if (camId == 0) { mCamera = Camera.open(Camera.CameraInfo.CAMERA_FACING_FRONT); } else { mCamera = … Read more

Converting preview frame to bitmap

Alternatively, if you DO need a bitmap for some reason, and/or want to do this without creating a YUVImage and compressing to JPEG, you can use the handy RenderScript ‘ScriptIntrinsicYuvToRGB’ (API 17+): @Override public void onPreviewFrame(byte[] data, Camera camera) { Bitmap bitmap = Bitmap.createBitmap(r.width(), r.height(), Bitmap.Config.ARGB_8888); Allocation bmData = renderScriptNV21ToRGBA8888( mContext, r.width(), r.height(), data); bmData.copyTo(bitmap); … Read more

Determine angle of view of smartphone camera

The Camera.Parameters getHorizontalViewAngle() and getVerticalViewAngle() functions provide you with the base view angles. I say “base”, because these apply only to the Camera itself in an unzoomed state, and the values returned by these functions do not change even when the view angle itself does. Camera.Parameters p = camera.getParameters(); double thetaV = Math.toRadians(p.getVerticalViewAngle()); double thetaH … Read more

techhipbettruvabetnorabahisbahis forumutaraftarium24eduseduedueduseduseduedueduedusedus