gpt4 book ai didi

php - 填充图像弧

转载 作者:搜寻专家 更新时间:2023-10-31 21:22:12 26 4
gpt4 key购买 nike

我正在尝试绘制一个用半透明颜色填充的圆弧(圆的一部分)。这可能吗?
我找到了 Imagearc,但它只画了线,还有 imagefilledarc 画了 3d 形弧。
并且有绘制完整圆圈的 eclipse 。

这些都不能满足我的需要。我可以使用什么来获取图像:
enter image description here

致:(请尝试超越我的绘画技巧)

enter image description here

主风的角度是150度,风的变化是120-190度,但是那个半透明的实心圆弧怎么画呢?
编辑;我还有中心点和线的直径。

最佳答案

实际上 imagefilledarc() 对此的正确功能。它不绘制 3D 形状 - 这只是 PHP 手册中给出的示例。

通过此代码使用您的第一张图片...

imagefilledarc(
$im, // gd image resource
512, // centre point x
325, // centre point y
285, // width (keep same as height for a perfect circle)
285, // height (keep same as width for a perfect circle)
120-90, // start (-90 degrees to start from 12 o'clock)
190-90, // end (-90 degrees to start from 12 o'clock)
0x40ff0000, // colour (50% transparent red)
IMG_ARC_PIE
);

...给我这个结果:

enter image description here

您需要做的就是用您的计算值(中心点、直径等)替换参数。

关于php - 填充图像弧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44607419/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com