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)
精彩评论