Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我有 TreeViewer 或 Table,或者我有一些按钮、包含不同文本的标签、图片等。现在,我想将这些导出到 SVG 图片。
有人知道吗?
非常感谢!
我不知道 SVG,但它org.eclipse.swt.graphics.ImageLoader可以用来保存org.eclipse.swt.graphics.GC各种格式,如 PNG、GIF、JPEG 和 BMP。如果您愿意,可以将结果转换为 SVG。
org.eclipse.swt.graphics.ImageLoader
org.eclipse.swt.graphics.GC
您可以找到如何将 GC 保存到文件的示例(例如这个)。copyArea您还可以使用该方法复制现有的 GC 。看看这个源代码。查找 gc.copyArea 方法的用法,您将找到如何拍摄此类快照的示例。
copyArea