zoukankan      html  css  js  c++  java
  • iOS Android图标生成器PHP

    <?php
    //修改为你想要的大小
    //$sizes = array(16,29,32,36,48,50,57,58,72,76,96,100,114,120,128,144,152);
    $sizes = array(72,50,29,58,57,114,512);
    //原始文件名(512X512)
    $filename = 'art.png';
    
    list($width, $height) = getimagesize($filename);
    
    foreach($sizes as $size){
    	$new_width = $new_height = $size;
    
    	$image_p = imagecreatetruecolor($new_width, $new_height);
    
    	$alpha = imagecolorallocatealpha($image_p, 0, 0, 0, 127);
    	imagefill($image_p, 0, 0, $alpha);
    	
    	$image = imagecreatefrompng($filename);
    	imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
    	imagesavealpha($image_p, true);
    	
    	//imagepng($image_p, 'icon-'.$size.'x'.$size.'.png');
    	imagepng($image_p, 'icon'.$size.'.png');
    }
    
  • 相关阅读:
    python之字典操作
    python之元组操作
    初始超算
    后缀自动机
    博弈
    曼哈顿最小生成树
    莫队算法
    主席树
    [HNOI2014]世界树
    [SDOI2011]消耗战
  • 原文地址:https://www.cnblogs.com/lein317/p/5067546.html
Copyright © 2011-2022 走看看