从加载项将图像导入到图像管理器 [英] Importing the image to image manager from add-in

查看:65
本文介绍了从加载项将图像导入到图像管理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在通过插件自动在EA中创建需求元素。但是问题是我们无法将目录中的图像导入到图像管理器中,也无法将超链接添加到需求元素说明中。因此,Enterprise Architect是否提供任何API来将图像从目录导入到图像管理器,并将超链接添加到需求元素说明。

We are automating the creation of requirement elements in EA through Add-in. But the problem is we are not able to import the images from the directory to Image manager and add the hyperlink to the Requirement Element Notes. So is there any API provide by Enterprise architect to Import the image from directory to Image manager and add the hyperlink to the Requirement Element Notes.

推荐答案

EA将图像存储在 t_image 中,其中 ImageID 是任意唯一ID, Name 是任意名称, Type 是位图,图像包含base64编码的原始图像数据(肯定会支持png和位图,可能会支持jpg,可能会支持pdf和emf,最终还会支持其他人)。我曾经用这种方式导入图像,因为通过参考数据(可能)的导入被打破了(并且可能仍然被打破)。您可以尝试一下:

EA stores images in t_image where ImageID is an arbitrary unique ID, Name is an arbitrary name, Type is "Bitmap" and Image contains the base64 encoded raw image data (png and bitmap are supported for sure, likely jpg will, pdf and emf probably and others eventually are supported as well). I once used to import images this way since the import via reference data (which is possible) was (and likely still is) broken. You might try that out:

xmlres = Respository.CustomCommand("Repository", "ImportRefData", sXML)

将从图像导出中读取参考数据。 sXML是该文件的XML字符串。罪魁祸首是没有正确导入ID。 IIRC导出包含那些base64编码的图像。因此,您可以为导入创建此类文件,而无需使用 Rerpositoy.Execute 直接操作数据库。

will read the reference data from an image export. sXML is the XML string of that file. The culprit was that the IDs were not imported correctly. IIRC the export contains those base64 encoded images. So you could create such a file for an import without the need to use Rerpositoy.Execute for manipulating the database directly.

这篇关于从加载项将图像导入到图像管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆