Stretched camera preview with size of 160x240 with front-facing camera on Droid 3

This is a discussion on Stretched camera preview with size of 160x240 with front-facing camera on Droid 3 within the Droid Development forums, part of the Droid Hacking category; I use code like shown below to choose one of the supported preview sizes for displaying the camera preview. What I am seeing is that ...

+ Reply to Thread
Results 1 to 1 of 1

Thread: Stretched camera preview with size of 160x240 with front-facing camera on Droid 3

  1. Droid Newbie
    shrib's Avatar
    Member #
    214742
    Join Date
    Aug 2011
    Posts
    1
    Phone
    Droid 3
    #1

    Stretched camera preview with size of 160x240 with front-facing camera on Droid 3

    I use code like shown below to choose one of the supported preview sizes for displaying the camera preview. What I am seeing is that if the chosen preview size is 240 x 160 (an unusual aspect ratio of 1.5), the preview looks stretched. ie. it looks like the camera is capturing at a lower aspect ratio (something like 1.3) and then stretching it to become 240 x 160. If any of the other supported preview sizes (128x96, 160x120, 176x144, 352x288, 320x240, 640x480) are chosen, the preview looks fine. Also, this only happens with the front-facing camera. The preview with the rear camera looks fine at 240 x 160.

    Is anyone else seeing this? Is this a known issue?

    Thanks,
    Shri

    Camera.Parameters params = camera.getParameters();
    params.setPreviewFormat(ImageFormat.NV21);
    params.setPreviewFrameRate(15);
    List<Camera.Size> supportedSizes = params.getSupportedPreviewSizes();
    // Chose one of the supportedSizes
    Camera.Size chosenSize = chooseSize(supportedSizes);
    params.setPreviewSize(chosenSize.width, chosenSize.height);
    camera.setParameters(params);
    Camera.Size previewSize = camera.getParameters().getPreviewSize();

    // Set the size of the SurfaceView to be proportional to the
    // aspect ratio of the preview size.
    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
    previewSize.width * 3, previewSize.height * 3);
    mySurfaceView.setLayoutParams(layoutParams);
  2. Sponsor
    DF Advertising
    Join Date
    Nov 2008
    Location
    DroidForums.net
     
     
     
     

Sponsors

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Similar Threads

  1. front facing camera
    By bhall238 in forum HTC ThunderBolt
    Replies: 25
    Last Post: 05-06-2011, 09:19 AM
  2. Droid 2 front facing camera?
    By madfakks in forum Droid General Discussions
    Replies: 1
    Last Post: 03-27-2011, 03:23 PM
  3. droid 1 front facing camera
    By steve.messer84 in forum Droid General Discussions
    Replies: 4
    Last Post: 03-10-2011, 12:40 PM
  4. Front facing camera
    By 45ga76 in forum Samsung Fascinate
    Replies: 1
    Last Post: 12-20-2010, 07:05 PM
  5. Front-facing camera on the DX?
    By Liltease111 in forum Droid X General Discussions
    Replies: 8
    Last Post: 11-13-2010, 11:40 AM

Search tags for this page

+android camera preview stretched
,
.getsupportedpreviewsize thunderbolt
,
android camera preview ratio
,
android camera preview scretch
,

android camera preview stretched

,
android camera streched
,
android camera stretched
,
android development camera stretched preview
,
camera on front of droid 1
,

droid 3 front camera

,

droid 3 front facing camera

,
droid x camera preview size
,

droid x reverse camera

,
how to use front camera droid 3
,

powered by vbulletin cameras

Click on a term to search our site for related topics.

Tags for this Thread