5:
6:header ("Content-type", "text/html;charset=utf-8");
7:
8:/*
9: * Picture is rotated along the y-axis, for example in PNG format
: * @param string $filename The URL of the picture
11: */
12:function turn_y ($filename)
13: {
*/ * Create a picture resource */
: $backy = Imagecreatefrompng ($filename);
16:
*/ * Get size */
: $widthy = Imagesx ($backy);
: $heighty = Imagesy ($backy);
20:
*/ * Create a new picture resource, save the flipped picture */
: $newy = Imagecreatetruecolor ($widthy, $heighty);
23:
+/ * Flips along the y-axis, copying the original image from right to left by one pixel width to the new resource individually */
25:
: imagecopy ($newy, $backy, $widthy-$i -1,0, $i, 0,1, $heighty);
: }
28:
*/ * Save the flipped picture */
: imagepng ($newy, ' http://www.bkjia.com/uploads/allimg/141009/0425435558-1.png ');
31:
*/ * FREE resources */
: Imagedestroy ($backy);
: Imagedestroy ($newy);
35:}
36:
37:/*
38: * Picture is rotated along the x-axis, for example in PNG format
In: * @param the URL of a string $filename picture
40: */
41:function turn_x ($filename)
42: {
*/ * Create a picture resource */
: $backx = Imagecreatefrompng ($filename);
45:
*/ * Get size */
A: $widthx = Imagesx ($backx);
: $heightx = Imagesy ($backx);
49:
*/ * Create a new picture resource, save the flipped picture */
Wuyi: $newx = Imagecreatetruecolor ($widthx, $HEIGHTX);
52:
-*/* flips along the x-axis, copying the original image from top to bottom by one pixel width to the new resource individually */
54:
: imagecopy ($newx, $backx, 0, $heightx-$i -1,0, $i, $WIDTHX, 1);
: }
57:
*/ * Save the flipped picture */
: imagepng ($newx, ' http://www.bkjia.com/uploads/allimg/141009/0425432228-2.png ');
60:
A:/ * Release resources */
: Imagedestroy ($backx);
A: Imagedestroy ($NEWX);
64:}
65:/* Call function */
66:turn_y (' http://www.bkjia.com/uploads/allimg/141009/0425435O8-0.png ');
67:turn_x (' http://www.bkjia.com/uploads/allimg/141009/0425435O8-0.png ');
:?>
70: Rotate along the y axis
71:
74: Rotate along the x axis
75:
Effect
http://www.bkjia.com/PHPjc/890204.html www.bkjia.com true http://www.bkjia.com/PHPjc/890204.html techarticle php Image manipulation: 3D graph, zoom, rotate, crop, add watermark (c) Source: http://www.ido321.com/887.html 5, PHP rotation of the image 1:2: Before rotation 3:4: 5:6: Header ("...