Home > PHP > Function > GD > imagecopyresampled()

imagecopyresampled()

imagecopyresampled - Copy and resize part of an image with resampling

Syntax

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)

Arguments

  • dst_image - Destination image link resource.
  • src_image - Source image link resource.
  • dst_x - x-coordinate of destination point.
  • dst_y - y-coordinate of destination point.
  • src_x - x-coordinate of source point.
  • src_y - y-coordinate of source point.
  • dst_w - Destination width.
  • dst_h - Destination height.
  • src_w - Source width.
  • src_h - Source height.

Description

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.

Version

PHP 4.0.6, 5

Return value

Returns TRUE on success or FALSE on failure.