I know imagecopyresampled is used to resize the image bt I m unable to understand its parameter
bool imagecopyresampled ( resource $dst_image , resource $src_image , int $dst_x , int $dst_y , int $src_x , int $src_y , int $dst_w , int $dst_h , int $src_w , int $src_h )
resource $dst_image -->Destination image link resource. But what exactly does it means.....
as when i tries to echo it from an example it returns Resource id #10 PLZ HELP....
Resizing image
Moderator: General Moderators
Re: Resizing image
Samir,
Without knowing what your end result is or where you are trying to place this image, this snippet of code might help you in whatever you are attempting to accomplish:
The functions used may vary depending on the image type and desired output.
Hope that helps.
Without knowing what your end result is or where you are trying to place this image, this snippet of code might help you in whatever you are attempting to accomplish:
Code: Select all
// Fetch existing image
$objOriginalImage = imagecreatefromjpg('myImage.jpg');
// Create new image
$objResizedImage = imagecreatetruecolor(400, 400);
// Resize
imagecopyresampled($objResizedImage, $objOriginalImage, 0, 0, 0, 0, 200, 200, 400, 400);
// Save resized image
imagejpeg($objResizedImage, 'myImageResized.jpg', 100);Hope that helps.