标签:blog color for div new size log c
$filename = ‘D://WWW/1.jpg‘; $p = 5; // Get new sizes list($width, $height) = getimagesize($filename); $newwidth = $width; $newheight = floor($height / $p); $last = $height % $p; // Load $source = imagecreatefromjpeg($filename); for( $i=0 ; $i< $p; $i++ ){ $_p = $newheight*$i; if( ( $i + 1 ) == $p ) $newheight += $last; $thumb = ImageCreateTrueColor($newwidth, $newheight); imagecopyresized( $thumb, $source, 0, 0, 0, $_p, $newwidth, $height, $width, $height); imagejpeg( $thumb , "./t{$i}.jpg" ,100); }
将图片平均分成几份。
标签:blog color for div new size log c
原文地址:http://www.cnblogs.com/glory-jzx/p/3891785.html