Book a Demo

Author Topic: Inserting images in EA with an addin  (Read 3368 times)

Rodolfo

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Inserting images in EA with an addin
« on: October 01, 2014, 05:11:24 am »
Im currently developing an addin in C# for Enterprise Architect than allows me to design a Table with Windows Forms and show it's as a t_diagramobject appearance (since the built-in table stereotype is ugly and not dynamic).

I'm already able to build my table the way i want, with dynamic columns, names and lines with my form. When i submit it, i take a screenshot of the table and store it in a variable. What i want is a way to save it in the Image Manager of EA, so i can set my t_diagramobject appearance to show that image.

I already searched for an Image object in the EA Interop.dll Namespace, but guess what? Found nothing. Even in the Repository object i couldn't find a collection of images or something related.

Is there a way to accomplish this?
Thanks!  :D ;D ;D ;D

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Inserting images in EA with an addin
« Reply #1 on: October 01, 2014, 05:51:02 am »
This is because the API does not support alt-images. You need to add a string to diagramObjects.objectStyle
Code: [Select]
ImageID=<id>;
where <id> is that of you image in t_image.

q.

Rodolfo

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Inserting images in EA with an addin
« Reply #2 on: October 01, 2014, 05:58:32 am »
Quote
This is because the API does not support alt-images. You need to add a string to diagramObjects.objectStyle
Code: [Select]
ImageID=<id>;
where <id> is that of you image in t_image.

q.

yeah, but in order to store images in t_images i need to use pure sql then ? isn't there a way to store them using the Repository object?
Also, images are stored in bytearrays or char64Strings ? ;D

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Inserting images in EA with an addin
« Reply #3 on: October 01, 2014, 08:19:37 am »
Yes, you need pure SQL. I once posted how to do that here on the forum. Try the search button top left or the Google Sparx group which shadows this forum.

q.