PHP combined with Jqueryjcrop to achieve a picture of practical examples,
We can often see some of the site has a picture cut function, perhaps you will feel this feature dazzling gorgeous, mysterious test! But today, a plug-in jquery dedicated to image trimming is introduced. Jcrop.min.js will uncover the mystery of the cut of the picture. The use of this plug-in can be very convenient to achieve this function, use only the mouse in the picture to select the selection, you can cut the picture into the selected parts, very suitable for the avatar of the cutting editing function.
This walkthrough is divided into two parts: HTML and PHP.
The first part, the HTML code:
Jcrop to achieve picture clipping
Part II: PHP Processing part crop.php:
<?phpif ($_server[' request_method ') = = ' POST ') {$targ _w = $targ _h =; $jpeg _quality =; $src = './image/b4.jpg '; $ Img_r = Imagecreatefromjpeg ($SRC); $DST _r = Imagecreatetruecolor ($targ _w, $targ _h); Imagecopyresampled ($dst _r, $img _r,0,0,$_post[' x '],$_post[' y '], $targ _w, $targ _h,$_post[' W '],$_post[' h ']); Header (' Content-type:image/jpeg '); Imagejpeg ($dst _r,null, $jpeg _quality); Exit;}? >
Add: jquery. Jcrop.min.js site Download Address: http://www.bkjia.com/jiaoben/24768.html
http://www.bkjia.com/PHPjc/847752.html www.bkjia.com true http://www.bkjia.com/PHPjc/847752.html techarticle PHP combined with Jqueryjcrop to achieve a picture of practical examples, we can often see some of the site has a picture cut function, perhaps you will feel this feature dazzling gorgeous, mysterious mo! But ... ..