Visa ett inlägg
Oläst 2012-09-03, 16:44 #10
pelmereds avatar
pelmered pelmered är inte uppkopplad
Har WN som tidsfördriv
 
Reg.datum: May 2010
Inlägg: 1 342
pelmered pelmered är inte uppkopplad
Har WN som tidsfördriv
pelmereds avatar
 
Reg.datum: May 2010
Inlägg: 1 342
Såhär kanske (otestad kod):
PHP-kod:
$curRatio $W1/$H1;
$maxRatio $MaxW/$MaxH;

if(
$curRatio $maxRatio)
{
 
$newW $MaxW;
 
$newH $currH * ($MaxW/$W1);
}
else
{
 
$newH $MaxW;
 
$newW $currW* ($MaxH/$H1);

pelmered är inte uppkopplad   Svara med citatSvara med citat