hadi2016
پنج شنبه 13 آذر 1393, 20:45 عصر
سلام
چطور میتونم عکسی رو که آپلود کردم سایزشو تغییر بدم؟
ashkufaraz
پنج شنبه 13 آذر 1393, 21:01 عصر
public function resizeImage($newWidth, $newHeight, $option="auto")
{
// *** Get optimal width and height - based on $option
$optionArray = $this->getDimensions($newWidth, $newHeight, strtolower($option));
$optimalWidth = $optionArray['optimalWidth'];
$optimalHeight = $optionArray['optimalHeight'];
// *** Resample - create image canvas of x, y size
$this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight);
imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height);
// *** if option is 'crop', then crop too
if ($option == 'crop') {
$this->crop($optimalWidth, $optimalHeight, $newWidth, $newHeight);
}
}
یه نگاه به این بنداز خوب راهنمایی م یکنه
http://code.tutsplus.com/tutorials/image-resizing-made-easy-with-php--net-10362
vBulletin® v4.2.5, Copyright ©2000-1403, Jelsoft Enterprises Ltd.