Copy CodeThe code is as follows:
/**
* Images class is a picture processing class
* @package Application.controllers
* @since 1.0
*/
Class Images
{
/**
* Zoom Picture
* @param $source Original picture
* @param $newfile New pictures
* @param $pre Scale
*/
Public Function Thumn ($source, $pre, $newfile)
{
Get picture size
List ($s _w, $s _h) =getimagesize ($source);
Create a new picture size
$new _w= $s _w* $pre;
$new _h= $s _h* $pre;
Create a new image
$new _f=imagecreatetruecolor ($new _w, $new _h);
Create an image with a resource picture
$sour _f=imagecreatefromjpeg ($source);
Copy a resource picture to a new image
Imagecopyresampled ($new _f, $sour _f, 0, 0, 0, 0, $new _w, $new _h, $s _w, $s _h);
Output image to Browser
Imagejpeg ($new _f, $newfile);
Imagedestroy ($new _f);
Imagedestroy ($sour _f);
}
}
?>
http://www.bkjia.com/PHPjc/621680.html www.bkjia.com true http://www.bkjia.com/PHPjc/621680.html techarticle Copy the code as follows:? PHP/** * Images class is a picture processing class * @package Application.controllers * @since 1.0 */class Images {/** * zoom picture * @ param $source Original picture ...