
imagecopyresized
(PHP 4, PHP 5)
imagecopyresized — 拷贝部分图像并调整大小
说明
bool imagecopyresized
( 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
)
imagecopyresized()
将一幅图像中的一块正方形区域拷贝到另一个图像中。dst_image
和 src_image
分别是目标图像和源图像的标识符。
In other words, imagecopyresized() 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).
如果源和目标的宽度和高度不同,则会进行相应的图像收缩和拉伸。坐标指的是左上角。本函数可用来在同一幅图内部拷贝(如果
dst_image 和 src_image
相同的话)区域,但如果区域交迭的话则结果不可预知。
参数
dst_image
目标图象连接资源。
src_image
源图象连接资源。
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
源图象的宽度。
src_h
源图象的高度。
返回值
成功时返回 TRUE, 或者在失败时返回 FALSE。
范例
Example #1 Resizing an image
This example will display the image at half size.
//