Book a Demo

Author Topic: Support transparent color for "alternate images"?  (Read 8615 times)

johnd-im

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Support transparent color for "alternate images"?
« on: September 27, 2014, 05:11:09 am »
Problem: EA always displays a white (or whatever color) rectangular box around the actual glyph I've assigned to entities in my UML diagrams. It doesn't seem to support transparent colors or layers/masks.

Question: How do I get EA to set/recognize transparent color for "alternate images" I create and assign to my model entities using the Image Manager or from the Settings/UMLTypes/Stereotypes/Metafile controls?


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Support transparent color for "alternate image
« Reply #1 on: September 27, 2014, 06:02:46 am »
The answer is simple: EA can't. It has been requested since years (I mean MANY years).

q.

Takeshi K

  • EA User
  • **
  • Posts: 632
  • Karma: +43/-1
    • View Profile
    • Sparx Systems Japan
Re: Support transparent color for "alternate image
« Reply #2 on: September 28, 2014, 09:34:20 am »
If I understand correctly, EA already supports transparent images for objects' alternate images.

I imported transparent PNG file in the Image Manager and apply it to an object in a diagram, EA recognizes transparent color. There is no way to specify background color in EA, so you need to make transparent PNG in other tool.
(I use Fireworks to make transparent PNG file.)

HTH
--
t-kouno

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Support transparent color for "alternate image
« Reply #3 on: September 29, 2014, 06:15:32 am »
Quote
EA already supports transparent images for objects' alternate images.

Transparency is such a new concept to EA (largely EA 11.06) that in my view it is still in the process of being rolled out across the product.
It certainly doesn't exist in any colour dialogues, and we are still hanging out for many other diagram enhancements such as colour gradient fill between two colours, or translucency in diagrams.
Again, in my view, what happens is a feature gets implemented. e.g. whiteboard diagrams, org charts, mind maps, and then rarely receives further enhancements and improvements.
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

johnd-im

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Support transparent color for "alternate image
« Reply #4 on: September 29, 2014, 11:06:53 am »
I've confirmed that a PNG with transparent color set can be applied as an "alternate image" (right click on entity/Appearance/Select Alternate Image.../Add New...) and is indeed rendered with the aforementioned transparent color transparent.

Unfortunately there's no way to make this work for all entities of a given stereotype via the Settings/UML Types/Stereotypes control (apparently only shape scripts or metafiles (.emf images) are supported in this control). Not very useful until I can associate a transparent glyph with a stereotype. Any other (undocumented) ideas?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Support transparent color for "alternate image
« Reply #5 on: September 29, 2014, 11:24:45 am »
Try the following shape script:

Code: [Select]
shape main
{
    image("mypicture.png",0,0,100,100);
}

where "mypicture.png" is the name you have given the image in the image manager. Please let us know if it works - I don't have a PNG with transparency to test it with.
The Sparx Team
[email protected]

johnd-im

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Support transparent color for "alternate image
« Reply #6 on: September 29, 2014, 11:58:39 am »
Unfortunately that doesn't seem to work. Just a gray box appears. Here's what I used:

shape main
{
   image("C:\Users\johnd\Downloads\server1a.png",0,0,71,92);
}

0,0,100,100 had the same effect.

How do I attach my transparent PNG to this post?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Support transparent color for "alternate image
« Reply #7 on: September 29, 2014, 12:08:42 pm »
The grey rectangle is what you get when the image can't be found. Go Settings | Images | Add New... and add your png file to the image manager. Then use whatever name you gave it in the image manager in the image() command in the shape script. Shape scripts can't import images from the file system.

PS If you want your image to be 71x92 pixels, still use 0,0,100,100 in the image() command (that's the image size as percentage of element size) but put defsize(71,92); before it.
The Sparx Team
[email protected]

johnd-im

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Support transparent color for "alternate image
« Reply #8 on: September 29, 2014, 12:37:01 pm »
Ok. Now it renders the image. Unfortunately it's a hideous depiction of the source PNG, including the surrounding background rectangle which was assigned the transparent color. Completely different than the rendering of the same PNG file set using the "Appearance/Select Alternate Image" control.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Support transparent color for "alternate image
« Reply #9 on: September 29, 2014, 01:59:58 pm »
That's a shame. Maybe worth sending in a bug report...
The Sparx Team
[email protected]

johnd-im

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Support transparent color for "alternate image
« Reply #10 on: September 29, 2014, 11:26:31 pm »
Yes, a shame. Thanks for the help. I learned some things while trying. Despite quirks, EA is the best. Will log a bug.