메뉴 건너뛰기

프로그램언어

?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
unction rotateImage($img, $rotation) {
 $width = imagesx($img);
 $height = imagesy($img);
 switch($rotation) {
 case 90: $newimg= @imagecreatetruecolor($height , $width );break;
 case 180: $newimg= @imagecreatetruecolor($width , $height );break;
 case 270: $newimg= @imagecreatetruecolor($height , $width );break;
 case 0: return $img;break;
 case 360: return $img;break;
 }
 if($newimg) {
 for($i = 0;$i < $width ; $i++) {
 for($j = 0;$j < $height ; $j++) {
 $reference = imagecolorat($img,$i,$j);
 switch($rotation) {
 case 90: if(!@imagesetpixel($newimg, ($height - 1) - $j, $i, $reference )){return false;}break;
 }
 }
 } return $newimg;
 }
 return false;
 }

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved