尝试使用 PHP 的 GD 库倾斜图像
我一直在到处寻找,尝试找到一个使用 GD 库使用 php 来倾斜图像的函数。我读过建议使用 ImageMagick 的线程,但不幸的是我无法访问我的服务器上的该库,所以我被迫使用 GD。 我正在寻找可以指定源图像和目标图像,然后为图像的每个角指定 4 组 X 和 Y 坐标的东西。所以像这样的东西将是理想的:
bool skewImage(resource $src_im, resource $dst_im, int $x1, int $y1, int $x2, int $y2, int $x3, int $y3, int $x4, int $y4)
如果有人拥有或知道这样或类似的功能,那就太棒了,谢谢!
I've been looking everywhere to try and find a function to skew an image with php using the GD library. I've read threads where ImageMagick has been suggested but I unfortunately don't have access to that library on my server so I'm forced to use GD.
I'm looking for something where I can specify the source image and destination image and then 4 sets of X and Y coordinates for each corner of the image. So something like this would be ideal:
bool skewImage(resource $src_im, resource $dst_im, int $x1, int $y1, int $x2, int $y2, int $x3, int $y3, int $x4, int $y4)
If anyone has or knows of a function like this or similar that would be awesome, thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PHP 手册是一个令人惊奇的地方。 此评论几乎涵盖了很多场景。使用“透视”部分。下面的示例稍作修改以使用图像的宽度和高度。
The PHP manual is an amazing place. This comment pretty much covers a lot of scenarios. Use the 'Perspective' section. Below example is slightly modified to use the width and height from the image.