Hi thanks for your reply I didn't check that yet. I will try that......
On Tuesday, 23 October 2012 17:38:06 UTC+5:30, Flame-Tree wrote:
>
> Have you tried you application on any other phone. As you are accessing
> setparameter/getparameter; which is more specific with your hardware
> support.
> Have you tried any android application<Camera> from Google play which
> behaves the way you would like. Confirm whether Phone provides the
> functionality or not
>
>
>
>
> On Monday, 22 October 2012 11:53:46 UTC+5:30, Haris wrote:
>>
>> Hi all For my application I am using android native camera and previewing
>> the image using surface view. But everything is working except the camera
>> orientation. When I open the camera by setting
>> screenOrientation="landscape on manifest file I am getting the preview
>> without any problem in landscape mode. But I need to take image in portrait
>> mode, for this I changed my manifest like
>> android:screenOrientation="portrait" and change my code like
>> mCamera.setDisplayOrientation(90), params.set("orientation",
>> "landscape"),params.set("rotation", 90), but still I am getting 90 degree
>> rotated image. I searched a lot but nothing solved my problem...
>>
>> And my code is
>>
>> public void setupCamera(int width, int height) {
>> Log.i(TAG, "setupCamera");
>> synchronized (this) {
>> if (mCamera != null) {
>> Camera.Parameters params = mCamera.getParameters();
>> List<Camera.Size> sizes =
>> params.getSupportedPreviewSizes();
>> List<Camera.Size>
>> imgsize=params.getSupportedPictureSizes();
>> mFrameWidth = width;
>> mFrameHeight = height;
>>
>> // mCamera.setDisplayOrientation(90);
>> params.set("orientation", "landscape");
>> params.set("rotation", 90);
>> // selecting optimal camera preview size
>> {
>> int minDiff = Integer.MAX_VALUE;
>> for (Camera.Size size : sizes) {
>> if (Math.abs(size.height - height) < minDiff) {
>> mFrameWidth = size.width;
>> mFrameHeight = size.height;
>> minDiff = Math.abs(size.height - height);
>> }
>> }
>> }
>>
>> params.setPreviewSize(getFrameWidth(), getFrameHeight());
>>
>>
>>
>>
>> List<String> FocusModes = params.getSupportedFocusModes();
>> if
>> (FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO))
>> {
>>
>> params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
>> }
>>
>> mCamera.setParameters(params);
>>
>>
>>
>> mCamera.startPreview();
>> }
>> }
>> }
>>
>>
>> I am using micromax A52 mmodel with android 2.3....
>>
>>
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en