views:

36

answers:

2

I have two different resolutions, the original one is 567x756 (wXh), the one which I want to display is 768x1024 (wXh). How to find out the scaling ratio for these two resolutions? For example if the font size used in 567x756 resolution is 7 pts then whats the values I should multiply with the font size (7 pts) to display the text in 768x1024 resolution.

Can anyone help me in this issue? Its little urgent.

Thanks in advance.

+1  A: 

The aspect ratios are the same for both resolutions, so just take one dimension and use that as your scaling ratio, i.e.

1024/756

Which is about 1.35. Or if you want to scale in the other direction, 0.738

Robert Harvey
hi thanks for ur reply, in this case it fine, in case if the display resolution is 512x768 (wxh) then we wont get the same ration, what to do in this case?
SWDeveloper
I think the answer is the same; the pixels are still going to be the same size, so...
Robert Harvey
How it ll be same, 768/756 is 1.0158 and 512/567 is 0.9029. Can u help me to find out the percentage difference between the resolutions?
SWDeveloper
Have you tried the ratio yet to see if it works?
Robert Harvey
+1  A: 

Whenever you hear "scaling", think "proportions":

You can set up a proportion, here:

old width      new width
---------  =   --------
old font       new font

 567      768
----  =  -----
 7         x

567*x = 5376

x = 9.48

So your new font is about 9.48, or 9 if you only want integers.

Alternatively, you could also use the height-to-height proportion in your calculations instead of width-to-width. Or use the average font height you'd get from doing either. Or do old_area/old_font^2 = new_area/new_font^2

If you want a way to find the scaling factor for any arbitrary new width:

old width      new width
---------  =   --------
old font       new font

 567      w
----  =  ---
 7        x

567*x = 7*w

x = (7/567) * w

Given your new w (or h, or w/e), the new font size is (7/567) * w

Justin L.