I found a formula for making 2 images proportional on a forum the other day.
The formula is: H1 / W1 = H2 / W2

Fujitsu Computer Systems Corporation

Example:
if (image1.height > image1.width) {
newWidth = (image1.width / image1.height) * preferredheight;
image1.height = preferredheight;
image1.width = newWidth;
}else {
newHeight = ((image1.height / image1.width) * preferredWidth);
image1.width = preferredWidth;
image2.height = newHeight;
}

Share and Enjoy:
  • Digg
  • Reddit
  • Slashdot
  • del.icio.us
  • StumbleUpon
  • TwitThis
  • Fark
  • Facebook
  • Technorati
  • Sphinn
  • Furl
  • Google
  • Mixx