Home  >  Article  >  Backend Development  >  php zoom image_PHP tutorial

php zoom image_PHP tutorial

WBOY
WBOYOriginal
2016-07-14 10:11:331285browse

How to use:


Set width and height, scaling at different proportions
include('SimpleImage.php');
$image = new SimpleImage();
$image->load('picture.jpg');
$image->resize(250,400);
$image->save('picture2.jpg');?>Set width and scale proportionally include('SimpleImage.php');
$image = new SimpleImage();
$image->load('picture.jpg');
$image->resizeToWidth(250);
$image->save('picture2.jpg');?>Set height and scale proportionally include('SimpleImage.php');
$image = new SimpleImage();
$image->load('picture.jpg');
$image->resizeToHeight(500);
$image->save('picture2.jpg');
$image->resizeToHeight(200);
$image->save('picture3.jpg');?> Scale to 50% include('SimpleImage.php');
$image = new SimpleImage();
$image->load('picture.jpg');
$image->scale(50);
$image->save('picture2.jpg');?>Output directly to the screen after scaling header('Content-Type: image/jpeg');
include('SimpleImage.php');
$image = new SimpleImage();
$image->load('picture.jpg');
$image->resizeToWidth(150);
$image->output();?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477328.htmlTechArticleUsage: Set width and height, scale at different proportions?php include(SimpleImage.php); $image = new SimpleImage(); $image-load(picture.jpg); $image-resize(250,400); $image-save(picture2....
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn