imagerotate

(PHP 4 >= 4.3.0, PHP 5, PHP 7)

imagerotate锟矫革拷锟斤拷锟角讹拷锟斤拷转图锟斤拷

说锟斤拷

imagerotate ( resource $image , float $angle , int $bgd_color [, int $ignore_transparent = 0 ] ) : resource

锟斤拷 src_im 图锟斤拷锟矫革拷锟斤拷锟斤拷 angle 锟角讹拷锟斤拷转锟斤拷bgd_color 指锟斤拷锟斤拷锟斤拷转锟斤拷没锟叫革拷锟角碉拷锟侥诧拷锟街碉拷锟斤拷色锟斤拷

锟斤拷转锟斤拷锟斤拷锟斤拷锟斤拷图锟斤拷锟斤拷锟斤拷模锟斤拷锟阶拷锟斤拷图锟斤拷岚达拷锟斤拷锟斤拷锟叫★拷锟斤拷屎锟侥匡拷锟酵硷拷锟侥达拷小——锟斤拷缘锟斤拷锟结被锟斤拷去锟斤拷

锟斤拷锟斤拷

image

锟斤拷图锟襟创斤拷锟斤拷锟斤拷(锟斤拷锟斤拷imagecreatetruecolor())锟斤拷锟截碉拷图锟斤拷锟斤拷源锟斤拷

angle

Rotation angle, in degrees. The rotation angle is interpreted as the number of degrees to rotate the image anticlockwise.

bgd_color

Specifies the color of the uncovered zone after the rotation

ignore_transparent

锟斤拷锟斤拷锟斤拷锟轿拷锟斤拷锟街碉拷锟斤拷锟酵革拷锟缴拷岜伙拷锟斤拷裕锟斤拷锟斤拷锟结被锟斤拷锟斤拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟斤拷锟斤拷锟斤拷转锟斤拷锟酵硷拷锟斤拷锟皆达拷锟� 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE锟斤拷

锟斤拷锟斤拷锟斤拷志

锟芥本 说锟斤拷
5.1.0 锟斤拷锟斤拷锟斤拷 ignore_transparent 锟斤拷

锟斤拷锟斤拷

Example #1 锟斤拷图锟斤拷锟斤拷转 180 锟斤拷

锟斤拷锟斤拷锟斤拷锟斤拷一锟斤拷图锟斤拷锟斤拷转 180 锟斤拷——锟斤拷锟铰颠碉拷锟斤拷

<?php
// File and rotation
$filename 'test.jpg';
$degrees 180;

// Content type
header('Content-type: image/jpeg');

// Load
$source imagecreatefromjpeg($filename);

// Rotate
$rotate imagerotate($source$degrees0);

// Output
imagejpeg($rotate);
?>

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

锟斤拷锟接碉拷锟斤拷锟斤拷锟斤拷锟酵硷拷锟斤拷锟阶� 180 锟斤拷

注锟斤拷

Note: 锟剿猴拷锟斤拷锟斤拷锟斤拷锟斤拷 GD 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 PHP 锟芥本锟叫匡拷锟矫★拷