这位老兄说的那个函数是只能对 图片90 180 270。等的度数进行翻转啊 不能进行图片水平、垂直翻转(上下,左右)

解决方案 »

  1.   

    function image_mirror ($input_image_resource)
    {
       $width = imagesx ( $input_image_resource );
       $height = imagesy ( $input_image_resource );
       $output_image_resource = imagecreatetruecolor ( $width, $height );
       $y = 1;   while ( $y < $height )
       {
           for ( $i = 1; $i <= $width; $i++ )
               imagesetpixel ( $output_image_resource, $i, $y, imagecolorat ( $input_image_resource, ( $i ), ( $height - $y ) ) );
           $y = $y + 1;
       }
       
       return $output_image_resource;
    }