zoukankan      html  css  js  c++  java
  • PHP 给GIF 缩略图实例代码

    请注意使用writeImages()而不是writeImage()

     1 <?php
     2 try
     3 {
     4     // Read in the animated gif
     5     $animation = new Imagick("animation.gif");
     6     
     7     // Loop through the frames
     8     foreach ($animation as $frame)
     9     {
    10         // Thumbnail each frame
    11         $frame->thumbnailImage(100, 100);
    12         
    13         // Set virtual canvas size to 100x100
    14         $frame->setImagePage(100, 100, 0, 0);
    15     }
    16     
    17     // Write image to disk. Notice writeImages instead of writeImage
    18     $animation->writeImages("animation_thumbnail.gif");
    19     echo "Images written";
    20 }
    21 catch (Exception $e)
    22 {
    23     echo $e->getMessage();
    24 }
    25 ?>
  • 相关阅读:
    Matrix
    Color the ball
    Coupons
    密码箱
    Milking Grid
    Substrings
    亲和串
    Jzzhu and Cities
    transition多个属性同时渐变(left/top)
    CSS3提供的transition动画
  • 原文地址:https://www.cnblogs.com/toby/p/2918480.html
Copyright © 2011-2022 走看看