千家信息网

一键生成各种尺寸Icon的php脚本方法

发表于:2025-01-20 作者:千家信息网编辑
千家信息网最后更新 2025年01月20日,这篇文章给大家介绍一键生成各种尺寸Icon的php脚本方法,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。实例如下:
千家信息网最后更新 2025年01月20日一键生成各种尺寸Icon的php脚本方法

这篇文章给大家介绍一键生成各种尺寸Icon的php脚本方法,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

实例如下:

 array    (     array("width" => 180,  "height"=> 180, "path"=>"ios8",   "name"=>"Icon-180.png"),     array("width" => 120,  "height"=> 120, "path"=>"ios8",   "name"=>"Icon-120.png"),     array("width" => 152,  "height"=> 152, "path"=>"ios8",   "name"=>"Icon-152.png"),     array("width" => 76,   "height"=> 76,    "path"=>"ios8",   "name"=>"Icon-76.png"),      array("width" => 144,  "height"=> 144, "path"=>"ios8",   "name"=>"Icon-144.png"),     array("width" => 72,   "height"=> 72,    "path"=>"ios8",   "name"=>"Icon-72.png"),     array("width" => 114,  "height"=> 114, "path"=>"ios8",   "name"=>"Icon-114.png"),     array("width" => 57,   "height"=> 57,    "path"=>"ios8",   "name"=>"Icon-57.png"),      array("width" => 100,  "height"=> 100, "path"=>"ios8",   "name"=>"Icon-100.png"),     array("width" => 50,   "height"=> 50,    "path"=>"ios8",   "name"=>"Icon-50.png"),      array("width" => 80,   "height"=> 80,    "path"=>"ios8",   "name"=>"Icon-80.png"),     array("width" => 40,   "height"=> 40,    "path"=>"ios8",   "name"=>"Icon-40.png"),     array("width" => 58,   "height"=> 58,    "path"=>"ios8",   "name"=>"Icon-58.png"),     array("width" => 29,   "height"=> 29,    "path"=>"ios8",   "name"=>"Icon-29.png"),   ),   "IOS" => array    (     array("width" => 180,  "height"=> 180, "path"=>"ios",    "name"=>"Icon-60@3x.png"),     array("width" => 120,  "height"=> 120, "path"=>"ios",    "name"=>"Icon-60@2x.png"),     array("width" => 152,  "height"=> 152, "path"=>"ios",    "name"=>"Icon-76@2x.png"),     array("width" => 76,   "height"=> 76,    "path"=>"ios",    "name"=>"Icon-76.png"),      array("width" => 144,  "height"=> 144, "path"=>"ios",    "name"=>"Icon-72@2x.png"),     array("width" => 72,   "height"=> 72,    "path"=>"ios",    "name"=>"Icon-72.png"),     array("width" => 114,  "height"=> 114, "path"=>"ios",    "name"=>"Icon-57@2x.png"),     array("width" => 57,   "height"=> 57,    "path"=>"ios",    "name"=>"Icon-57.png"),      array("width" => 100,  "height"=> 100, "path"=>"ios",    "name"=>"Icon-50@2x.png"),     array("width" => 50,   "height"=> 50,    "path"=>"ios",    "name"=>"Icon-50.png"),      array("width" => 80,   "height"=> 80,    "path"=>"ios",    "name"=>"Icon-40@2x.png"),     array("width" => 40,   "height"=> 40,    "path"=>"ios",    "name"=>"Icon-40.png"),     array("width" => 58,   "height"=> 58,    "path"=>"ios",    "name"=>"Icon-29@2x.png"),     array("width" => 29,   "height"=> 29,    "path"=>"ios",    "name"=>"Icon-29.png"),   )   ,   "ANDROID" => array   (     array("width" => 144,  "height" => 144,   "path" => "android/drawable",      "name"=>"icon.png"),     array("width" => 144,  "height" => 144,   "path" => "android/drawable-xhdpi", "name"=>"icon.png"),     array("width" => 72,   "height" => 72, "path" => "android/drawable-hdpi",    "name"=>"icon.png"),     array("width" => 48,   "height" => 48, "path" => "android/drawable-mdpi",    "name"=>"icon.png"),     array("width" => 32,   "height" => 32, "path" => "android/drawable-ldpi",    "name"=>"icon.png")   ) );   foreach ($IconArray["IOS8"] as $key => $IconType)  {   thumb("icon.png",$IconType['width'],$IconType['height'],$IconType['path'],$IconType['name']); }  foreach ($IconArray["IOS"] as $key => $IconType)  {   thumb("icon.png",$IconType['width'],$IconType['height'],$IconType['path'],$IconType['name']); }  foreach ($IconArray["ANDROID"] as $key => $IconType)  {   thumb("icon.png",$IconType['width'],$IconType['height'],$IconType['path'],$IconType['name']); }  ?>

关于一键生成各种尺寸Icon的php脚本方法就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

0