PHP GD - 调整图像框架/画布的大小,但不调整实际图像的大小
我有一个尺寸为 88x31 的图像,想将其设置为 100x100,而不调整实际图像的大小,而只调整其画布/框架的大小,也许可以通过将其复制到尺寸为 100x100 的新空白白色图像的中心来实现。有什么想法如何去做吗?
I have an image with size 88x31 and would like to make it 100x100 without resizing the actual image but only its canvas/frame, maybe by copying it in the center of the new blank white image with 100x100 size. Any ideas how to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正确的方法是创建一个新图像,然后将旧图像复制到其中(假设起始图像是 JPEG 并且小于 100x100):
The correct method is to create a new image and then copy the old image into the middle of it (assuming the starting image is is a JPEG and smaller than 100x100):