$x  =  $_GET [ 'x' ]; //客户端选择区域左上角x轴坐标   

$y  =  $_GET [ 'y' ]; //客户端选择区域左上角y轴坐标   

$w  =  $_GET [ 'w' ]; //客户端选择区 的宽   

$h  =  $_GET [ 'h' ]; //客户端选择区 的高   

$filename  =  "c:/myimg" ; //图片的路径   

$im  = imagecreatefromjpeg( $filename ); // 读取需要处理的图片   

$newim  = imagecreatetruecolor(100, 100); //产生新图片 100 100 为新图片的宽和高     

imagecopyresampled($newim ,  $im , 0, 0,  $x ,  $y , 100, 100,  $w ,  $h );  

//参数[1] [2] [3][4] [5] [6] [7]  [8]  [9] [10]   

//[5]  客户端选择区域左上角x轴坐标   

//[6]  客户端选择区域左上角y轴坐标   

//[7]  生成新图片的宽   

//[8]  生成新图片的高   

//[9]  客户端选择区 的宽   

//[10] 客户端选择区 的高             

imagejpeg($newim ,  $filename );  

imagedestroy($im );  

imagedestroy($newim ); 

相关文章:

  • 2022-12-23
  • 2021-11-04
  • 2021-11-05
  • 2021-11-28
  • 2021-06-11
猜你喜欢
  • 2021-04-23
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
  • 2021-04-11
  • 2022-12-23
  • 2021-12-29
相关资源
相似解决方案