1

I used tools like gimp, markman and photoshop to measure the psd file given by ui. But they all measured in px, but what i wanted is dp. So i always need to divide 2 or something to make it right.

So do you got any tool to measure in dp?

Or any tool to divide the measure result with certain number?

Frank Cheng
  • 5,928
  • 9
  • 52
  • 80

2 Answers2

2

See What is the difference between "px", "dp", "dip" and "sp" on Android?

You really can't just 'convert', as 10dp will be different px even between Android devices.

It's like saying: I have 10 pounds of food, how many meals is that?

You can't answer because, babies eat less than adults.

Community
  • 1
  • 1
hatcyl
  • 2,190
  • 2
  • 21
  • 24
  • 1
    To be exact, 1dp is 1/160th of an inch. So you use dp to make sure things are physically the same size, instead of being the same number of pixels. The dp to px ratio varies by device dpi. You can calculate that in your app, but not all devices correctly set the device DPI, so those devices which don't will screw up the calculation. – Gabe Sechan Aug 05 '14 at 01:58
  • Thanks for your answer. If i assume all the psd i got the size is 720p and most of 720p devices got 320 dpi. So i just divide the px i with 2 and use it as dp. I works fine until now. – Frank Cheng Aug 05 '14 at 02:03
0

Select menu Image/Print size.

In the bottom dropbox select pixels/pt In X resolution type the number you usually divide by. 3.5 on my Nexus 6P. On the status bar, change the dropbox from pixels (px) to points (pt) Select the Measure tool

Now you can measure directly in dp's