|
imagecopyresampledCopy and resize part of an image with resampling Description
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
)imagecopyresampled copies a rectangular portion of one image to another image, smoothly interpolating pixel values so that, in particular, reducing the size of an image still retains a great deal of clarity.
In other words, imagecopyresampled will take a
rectangular area from
If the source and destination coordinates and width and heights
differ, appropriate stretching or shrinking of the image fragment
will be performed. The coordinates refer to the upper left
corner. This function can be used to copy regions within the
same image (if Parameters
Return Values
Returns Examples
Example #1 Simple example This example will resample an image to half its original size.
<?php The above example will output something similar to:
Example #2 Resampling an image proportionally This example will display an image with the maximum width, or height, of 200 pixels.
<?php The above example will output something similar to: Notes
See Alsoimagecopyresized |