PDA

View Full Version : کمک در مورد یک اسکریپت



elyass-pc
پنج شنبه 08 مرداد 1388, 18:32 عصر
من برای تغییر اندازه عکس از اسکریپت زیر میخوام استفاده کنم ولی نمیدونم چطور ازش استفاده کنم کسی میتونه راهنماییم کنه؟
function setsize($wimg = "", $himg = "")
{
//.................................................. ..........
if (($wimg != "") OR ($wimg != NULL))
{
if (strstr($wimg, "%"))
{
$a2 = substr($wimg, 1);
$wimg = ($this-> fsw * ($a2 / 100));
}
}
else $wimg = $this-> fsw;
if (($himg != "") OR ($himg != NULL))
{
if (strstr($himg, "%"))
{
$a3 = substr($himg, 1);
$himg = ($this-> fsh * ($a3 / 100));
}
}
else $himg = $this-> fsh;
//.................................................. ..........
$nim = imagecreatetruecolor($wimg, $himg);
imagecopyresized($nim, $this-> im, 0, 0, 0, 0, $wimg, $himg, $this-> fsw, $this-> fsh);
//.................................................. ..........
$this-> im = $nim;
$this-> fsw = $wimg;
$this-> fsh = $himg;
//.................................................. ..........
}