PHP combined with Jqueryjcrop to achieve picture cutting practical examples, _php tutorial

Source: Internet
Author: User

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 ... ..

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.