PHP:创建图片左上角的缩略图
我有这个大的 png 文件,现在我想创建左上角的缩略图。
png 大约是 600x1000 像素,缩略图应该位于其左上角 400x300 像素。
如果你能帮助我那就太好了! (因为谷歌只显示如何缩略图整张图片)
I have this large png file and now I want to create a thumbnail of the upper left corner.
The png is like 600x1000 pixels, the thumbnail should be top left 400x300 pixels of it.
Would be awesome if you can help me out! (Since google only shows how to thumbnail the ENTIRE picture)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 PHP 中的 imagecopyresampled 函数复制源图像的一部分,并将其缩放到您想要的任何大小。
请检查 PHP 文档以了解该函数。
http://www.php.net/manual/en/function.imagecopyresampled.php
You can use imagecopyresampled function in PHP to copy part of a source image and also scale it to any size you want.
Please check the PHP documentation for the function.
http://www.php.net/manual/en/function.imagecopyresampled.php