Importing the image to image manager from add-in

强颜欢笑 提交于 2019-12-02 02:42:17

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)

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.

EA doesn't provide any API calls for importing images into image manager.

Image details will be stored in t_image table and the content will be stored in an encrypted blob data.so its tricky to even insert the data directly in the table.

Additional Info:(off topic) But you can set alternate images in Style property of DiagramObject class. dobj.Style="DUID=6F937472;NSL=0;ImageID=1287454794;LBL=CX=128:CY=78:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=1:ALT=0:ROT=0;", String,";

Alternate Solution:

If you want to link an image to the requirement , insert that image in a word document and you can add that document as LinkedDocument for that requirement by using

element.LoadLinkedDocument

For more detrails on LoadLinkedDocument and refer in element class for LoadLinkedDocument

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!