|
imagecopyresampled(PHP 4 >= 4.0.6, PHP 5) imagecopyresampled — Copy and resize part of an image with resampling Описание
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 an rectangular area from src_image of width src_w and height src_h at position (src_x,src_y) and place it in a rectangular area of dst_image of width dst_w and height dst_h at position (dst_x,dst_y). 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 dst_image is the same as src_image) but if the regions overlap the results will be unpredictable. Список параметров
Возвращаемые значенияВозвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки. Примеры
Пример #1 Simple example This example will resample an image to half its original size.
<?php Результатом выполнения данного примера будет что-то подобное:
Пример #2 Resampling an image proportionally This example will display an image with the maximum width, or height, of 200 pixels.
<?php Результатом выполнения данного примера будет что-то подобное: Примечания
Смотрите такжеimagecopyresized() - Copy and resize part of an image |
|