Solved

Image padding

Posted on 2011-02-28
6
393 Views
Last Modified: 2013-11-19
I am stuck on this very important part and which is ruining my system.

Presently to maintain the aspect ratio Android changes the image width and height of an image i.e it pads it to maintain the aspect ratio

How can I know how many lines of pixels were added. Is there an API, formula ?

The reason is that my application adds tags to an image with x, y information on another platform . When I open it on my ANdroid device the image resolution is changed, so my tags look out of place. If I know how android calculates this I can apply the same for the orientation of my tags and work around

Your help would be greatly appreciated..Thanks in advance
0
Comment
Question by:jbajaj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 21

Accepted Solution

by:
oleggold earned 500 total points
ID: 35003621
0
 
LVL 5

Expert Comment

by:UnConn
ID: 35008271
I think you have two choices.

- Make your layout scale.  Do not put your tags in postitions relative to pixels as they can change between device screen sizes.  Android programing best practices state this too.  If you use a layout that scales then the layout should scale relative to the image.

- Use PS instead of PX.  PX uses pixels but PS uses the scaled resolution based on DPI.
0
 

Author Comment

by:jbajaj
ID: 35025566
Hi oleggold,

  I didn't get any idea from http://www.codeweblog.com/stag/android-alchemy-formula-list/   site. Please
explain me how this site will help me. Or if you have any idea then please explain me.

Thank you.
0
 
LVL 5

Expert Comment

by:UnConn
ID: 35028966
There is one more option and this is providing graphics for each version of the screen you will support, LDPI, MDPI, and HDPI.  This assumes you are running on 1.6 and above (minSdkVersion="4")
0
 

Author Closing Comment

by:jbajaj
ID: 35190431
good
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PaperPort 14.5 Patch 1 update is often not detected or downloaded automatically. This article provides direct download links to solve the problem for retail (non-bundled) versions of the Standard and Professional editions, as well as the Professiona…
In this post we will learn different types of Android Layout and some basics of an Android App.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question