Windows PHP5.5.6 + imagick extension ____php

Source: Internet
Author: User
Tags imagemagick
#windows下 PHP5.5.6 + imagick extension 1, install Imagemagick-6.8.7-7-q16-x64-dll.exe first. Download Address: Http://www.imagemagick.org/script/binary-releases.php#windows can select a different version. 2, decompression Php_imagick-3.1.2-5.5-ts-vc11-x64.zip, will php_imagick.dll into the ext directory of PHP. Can download according to Imagick version, download address: Http://pecl.php.net/package/imagick Click DLL, you can enter the corresponding PHP version. When downloading, note non-thread-safe and Thread-safe, which apply to IIS, and the latter for Apache. 3, open php.ini, add Extension=php_imagick.dll, restart Apache.
Instructions for use:
<?php
$image =new imagick ("1.jpg");
$array = $image->getimageresolution (); Returns the image resolution, x and Y axis information
print_r ($array);
Output array ([x] => [y] =>)
?>
Function Description: $images = new Imagick ("ALIM2382. JPG ");//New Imagick class
$images->getimageheight ()//Get Picture high
$images->getimagewidth ()//Get picture width
$images->thumbnailimage (100,100);////change the size of the picture
$images->writeimages ("ALIM2382. JPG, True);//write an image or image sequence
$images->writeimage ("ALIM2382. JPG ");/write an image
$images->destroy ()//Destroy picture
$images->borderimage (New Imagickpixel ("Red"), 3, 3);//Set picture border red, border 3
$images->modulateimage (50, 0, 0); Control brightness, saturation, hue
$images->compositeimage ($im, Imagick::composite_over, 10, 20);//To fit two images together.
$images->setimageformat (' jpeg ');//Set Picture format
$images->getimageresolution ()//Return image resolution, x and Y axis information
$images->getimageunits ()//Return image resolution unit
$images->resampleimage ()//to resample at the desired resolution
$images->setimageresolution ()/Set resolution
Set resolution Unit $images->setimageunits ()/
echo $images//Display
Please refer to Http://cn.php.net/imagick website

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.