在 PlantUML 盐线框中引用本地图像

发布于 2025-01-20 19:06:04 字数 401 浏览 2 评论 0原文

我正在尝试将本地图像包含到我的 PlantUML salt 线框中,以用于 Ubuntu 20.04 中的 GUI 文档。 PlantUMl 参考页面仅显示如何包含 http 链接。如何做到这一点?

我尝试了以下操作,但输出中出现“无法解码”。

@startsalt
scale 2
{

title Test Page
{S

{^"Figure"
<img:file://./pie-chart.png>
<img:file://./pie-chart.png>
<img:.\pie-chart.png>
}
..

}

}
@endsalt

I'm trying to include a local image into my PlantUML salt wireframe for my GUI documentation in Ubuntu 20.04. The PlantUMl reference page only shows how to include a http link. How to do this?

I tried the following, but I'm getting "Cannot decode" in the output.

@startsalt
scale 2
{

title Test Page
{S

{^"Figure"
<img:file://./pie-chart.png>
<img:file://./pie-chart.png>
<img:.\pie-chart.png>
}
..

}

}
@endsalt

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

↙温凉少女 2025-01-27 19:06:04

如果将图像blah.png存储在与Plantuml源同一位置的位置,这将有效:

@startsalt
scale 2
{

title Test Page
{S

{^"Figure"
<img:blah.png>
}
..

}

}
@endsalt

我在(Windows)机器上:

net/lx5on.png“ rel =” nofollow noreferrer“>

我的Windows机器上有WSL,因此我在Ubuntu启动了Vscode,并为VSCODE安装了Plantuml插件。我创建了一个文件/home/me/test/blah.png(从我的Windows复制),然后创建以下存储在/home/me/me/test.wsd :

@startsalt
'scale 1
{

title Test Page
{S

{^"Figure 0"
<img:test/blah.png>
}
{^"Figure 1"
<img:./test/blah.png>
}
{^"Figure 2"
<img:"/home/me/test/blah.png">
}
{^"Figure 3"
<img src="/home/me/test/blah.png">
}
{^"Figure 4"
<img src="test/blah.png">
}
..

}

}
@endsalt

“

它具有相对和绝对路径,带有用于指定图像的src =替代方案。我可以让它们全部与我的Ubuntu 20上的PNG文件一起使用(再次使用vScode的Plantuml扩展程序)。我应该声明我将其配置为使用Plantuml Server。如果您使用较旧版本的Plantuml(Ubuntu的Apt会可悲地带来一个古老的版本)。

If you store the image blah.png at the same location as the PlantUML source, this will work:

@startsalt
scale 2
{

title Test Page
{S

{^"Figure"
<img:blah.png>
}
..

}

}
@endsalt

I get on my (windows) machine:

enter image description here

Edit: WSL (Ubuntu) test

I have WSL on my Windows machine, and so I started up VSCode in Ubuntu, and installed the PlantUML plugin for VSCode. I created a file /home/me/test/blah.png (copied from my Windows), and then created the following PlantUML file stored in /home/me/test.wsd:

@startsalt
'scale 1
{

title Test Page
{S

{^"Figure 0"
<img:test/blah.png>
}
{^"Figure 1"
<img:./test/blah.png>
}
{^"Figure 2"
<img:"/home/me/test/blah.png">
}
{^"Figure 3"
<img src="/home/me/test/blah.png">
}
{^"Figure 4"
<img src="test/blah.png">
}
..

}

}
@endsalt

Ubuntu (WSL) rendering

It has relative and absolute paths, with the src= alternative for specifying images. I can get them all to work with png files on my Ubuntu 20 (again, using the PlantUML extension for VSCode). I should state that I have it configured to use the PlantUML server. If you're using an older version of PlantUML (Ubuntu's apt will sadly bring over an ancient one).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文