开发者

Image Resize with constraint proportion and tranparancy

开发者 https://www.devze.com 2023-02-25 15:09 出处:网络
How do开发者_如何学C i resize image preserving its dimension ratio proportion and transparancy in phpUse the GD library from MicroMVC. It\'s the smallest, fastest GD lib out there.The function you wan

How do开发者_如何学C i resize image preserving its dimension ratio proportion and transparancy in php


Use the GD library from MicroMVC. It's the smallest, fastest GD lib out there.


The function you want is called imagecopyresampled(); don't forget to only use true color images for destinations. Here is a comment which talks specifically about preserving transparency: http://www.php.net/manual/en/function.imagecopyresampled.php#93166 (note the usage of the imagecolorallocatealpha() function)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号