| | |||||
| ||||||||
| The Break Room Casual discussion about non-industry related topics. |
![]() | NamePros Account Upgrade | Forum Sponsorship |
| Take advantage of our upgraded membership levels (2 levels to choose from) so you can have MORE active sales threads, Custom Titles, A Directory Listing, Invisible Mode, Message Tracking, And MORE! | ||
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: May 2003
Posts: 2,187
![]() ![]() ![]() | whos good at maths? hey i suck at maths big time and i got a problem im making a image script for someone if an image is wider than 700px the hole page distorts and looks crap i can set the width and the height of the image easily but if i set the image width to 700 it looks like its been stretched because of the height so what i need to do is to find out a ratio/scale/%age of the height to the width so the image wont look distored or stretched and then im going to provide a link to the full size image... anyone got any ideas? thanks adam |
| |
| | #2 (permalink) |
| Hi :) Join Date: Mar 2004 Location: NC
Posts: 9,537
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Eg : 468 H 60 H 468 / 60 = 7.8 So your W should remain 7.8 times your H - You'll need Both Actual Dimensions W = Width H = Height Does this help ?
__________________ When the man at the door yelled "Alcohol , Tobacco , and Firearms" .... I just assumed it was a delivery ! |
| |
| | #3 (permalink) | ||||
| Senior Member Join Date: Jun 2003 Location: Naperville Illinois
Posts: 1,786
![]() ![]() ![]() ![]() | yeah i know what to do. Lets say your max width is 300 px and somebody submits an image that is 600 px wide and 200 px high. newWidth = maxWidth newHeight = (maxWidth * originalHeight) / originalWidth That should keep the images scaled
__________________
| ||||
| |