gpt4 book ai didi

javascript - 如何使用 SVG 画线?

转载 作者:行者123 更新时间:2023-11-30 15:48:20 25 4
gpt4 key购买 nike

如何使用 SVG 绘制连接 2 个图像的线?。例如我想画一条线连接 $1 和 $2(假设 $1 和 $2 是图像):

$1
$2

是否需要 Javascript?

谢谢!

最佳答案

您可以轻松地 draw a line with SVG并将其放置在您的图片之间:

<img src="http://placehold.it/100x100">
<svg width="100" height="100" viewPort="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<line x1="0" y1="20" x2="100" y2="80" stroke-width="2" stroke="black" />
</svg>
<img src="http://placehold.it/100x100">

关于javascript - 如何使用 SVG 画线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39739674/

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