化方为圆

 $minl){
					$y = $minc + $ll;
				}else{
					$y = $minc - $ll;
				}

				$xx = asin($lx/$l)/(M_PI /4) * $ll;
				if($wi > $minl){
					$x = $minc + $xx;
				}else{
					$x = $minc - $xx;
				}


			}elseif($ly < $lx){
				if($wi > $minl){
					$x = $minc + $ll;
				}else{
					$x = $minc - $ll;
				}

				$xx = asin($ly/$l)/M_PI *4 * $ll;
				if($hi > $minl){
					$y = $minc + $xx;
				}else{
					$y = $minc - $xx;
				}

			}else{
				if($wi > $minl){
					$x = $minc + $ll;
				}else{
					$x = $minc - $ll;
				}

				if($hi > $minl){
					$y = $minc + $ll;
				}else{
					$y = $minc - $ll;
				}
			}


			$xxx = $l / $minl;
			$yyx = ($wi - $minl) /2 * sqrt(M_PI) +$minc;
			$yyy = ($hi - $minl) /2 * sqrt(M_PI) +$minc;

			$x = $yyx + ($x - $yyx) * $xxx;
			$y = $yyy + ($y - $yyy) * $xxx;







			$rgb = imagecolorat($img, $x, $y);
			imagesetpixel ($im , $wi , $hi ,$rgb);
		}
	}
}
//$rgb = imagecolorat($img, 100, 100);

//imagesetpixel ($im , int $x , int $y ,$rgb);


imagepng($im,'b.png');

 

转载于:https://my.oschina.net/u/2356887/blog/1861600

你可能感兴趣的:(php)