Author Topic: Extract images/icons with Java Api  (Read 2742 times)

JavaDev

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Extract images/icons with Java Api
« on: March 11, 2014, 02:31:35 am »
Hello developers,

I'am working with the EA Java API to retrieve informations in EA Projects.

In one UseCase i have to retrieve the images/icons which are used for each object in EA.

Is it possibile to access them with the Java API (for example as Base64 encoded string) ?  
How stores EA the Images/Icons of objects?

Thank you in advance for any help!

« Last Edit: March 11, 2014, 02:34:39 am by fmisir »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Extract images/icons with Java Api
« Reply #1 on: March 11, 2014, 03:37:28 am »
You can query the t_image table via Repository.SQLQuery and read the Image column.

Have a look in my Inside book for more details.

q.
« Last Edit: March 11, 2014, 03:38:19 am by qwerty »

JavaDev

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Extract images/icons with Java Api
« Reply #2 on: March 11, 2014, 05:59:19 am »
Thank you!

I tried it out. The Query i used is bellow:

SELECT * From t_image

I got a List with all used images, however i need the associated Elements too. The Element Object in the Java API dont't have anything like an Image ID. How i have to create the Query?


I read the free  version of your book. There are a list of all tables in the  free version. Is complete Database Schema as Image too?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Extract images/icons with Java Api
« Reply #3 on: March 11, 2014, 01:05:52 pm »
Well, my book does not unveil all secrets, but quite a lot.

The image id is stored in DiagramObject.style where it is coded like ImageID=297227575;

q.

JavaDev

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Extract images/icons with Java Api
« Reply #4 on: March 11, 2014, 06:58:49 pm »
Thank you! ..

Thats helped me a lot!