Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8759025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:41:50+00:00 2026-06-13T14:41:50+00:00

in my app I have a preview screen. On one device (LG, with Android

  • 0

in my app I have a preview screen. On one device (LG, with Android 2.2, 320×480 screen) and another one (HTC, with Android 2.3, 480×800 screen) everything is OK. In both cases the list of supported preview sizes include one that fits the screen size exactly, I choose it and the image is perfect.
The problem comes with yet another device, having a screen similar to the first one (Samsung, Android 2.3, 320×480 screen). Regardless of the fact that I select a preview size that fits the screen size, as in previous cases, the image doe not preserve its aspect ratio; circles appear oval; the image is squeezed along the short axis of the screen. It seems the hardware itself, in order to obtain a 320×480 preview, squeezes the image (the camera has a form factor 4:3, while the screen has a form factor 3:2).
So I have altered the layout params of the view where the preview appears, in order to fit the form factor of the camera (size: 360×480. This PARTIALLY solves the problem; actually, to solve it completely I had to set 380×480 (!!!).
The fact is that I can’t possibly find any API that tells me about this different behavior, so that I can automatically compensate for it. Not even the Camera.Parameters.getHorizontalViewAngle and Camera.Parameters.getHorizontalViewAngle seem to be helpful; they give the same values on all of the three devices!
Can anyone help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:41:51+00:00Added an answer on June 13, 2026 at 2:41 pm

    After deeper investigation, that included writing ad-hoc code to check how the preview is actually shown on the screen, this is what I found out.
    On one device (LG E-720), the preview image is cropped in order to obtain a 3:2 form factor, then it is resized to fit on the screen. Aspect ratio is preserved:
    enter image description here

    On the second device (Samsung ACE), the preview image appears to be cropped in a different way, resulting in a 5:4 image (!?), that is then resized to fit on screen. Due to the different form factors, the image on screen appears squeezed.:
    enter image description here

    I have checked whether a software update was available for the second device, but this wansn’t the case. So in order to get a more or less correct image on screen, I have defined the target view as being 384 pixels tall; this actually causes a cropping that restores the correct aspect ratio. It doesn’t compensate, though, a small horizontal shift due to the fact that the original cropping is horizontally asymmetric.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have camera preview on my android app but when I add an 'id'
I have an app objects and image objects which are linked to one another
I have a video app that does both a live preview as well as
I have successfully implemented printing and print preview for my app using the PrintDocument,
My app have a background image that fills the screen. I'd like to display
I'm currently developing a camera app, where I have to set the camera preview
I am working on android camera app,I want green screen chroma key effect to
I have an android app through which I can successfully update the twitter status.
i have an app which has btn to preview report made in crystal report.
I have recently built an application that shows you a camera preview on screen.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.