?
Solved

Image padding

Posted on 2011-02-28
6
Medium Priority
?
397 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 1000 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

If your app took Google’s lash recently, here are the 5 most likely reasons.
When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
Learn how to create interesting presentations by including videos to keep your audience engaged using Prezi. Select "Insert" from the top menu in your Prezi editor: Select "YouTube Video": Paste the video URL into the prompt: "Select "Insert":…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Suggested Courses

764 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