Closed peterprib closed 6 years ago
Hi Peter,
I'm not sure to understand what you mean by "reflection of original image".
To change the icon on diagram objects, three conditions must be met:
the diagram object must have an existing icon For instance, the Node element has got two figures. The left one does not have an icon, so the plugin cannot change it. The right one has got an icon, so the plugin can change it. this is the same for all the diagram objects that have got two figures.
an "icon" property should be set with an existing icon filename (that should be located in the editor/img subfolder) If the icon is changed in the model explorer, then I beleive this condition is met on your computer.
the plugin should be configured to do so You may either choose the option "always replace icons with icon property" to replace icons in all your views, or create a "replace icons" property on one view with the value "true".
Hope this helps. If not, could you please provide me with instructions to reproduce your issue ?
Best regards Hervé
This happens to properties
This on image extensions/desktop-computer.png
Just worked out white was part of image. That is, it doesn't auto size image to box size
At the moment, the icon (image) is shown with a 1:1 ratio. Currently, there is not possible to have auto resize. So you need to manually resize the image on disk. Please note that if you replace the png file while Archi is running, it may not change the image in the view because of the cache so you'll need to restart Archi to see the new image size.
I'm working to an update that will allow to dynamically resize the image but at the moment, I'm stuck because until now I fail to insert the resized image into Archi's cache which leads to a huge memory consumption.
Would it not be better to transform at render time as the image my be resized anyway?
It would definitively ease my life but as elements are meant to show icons not images.
The Eclipse framework redraw them very often and to speedup the process and reduce the memory consumption, the Archi developers have put in place a cache. So the icon (or image in our case) needs to be calculated from the icon/image file only once.
The way I develop my plugin does not allow it to access this cache so if I dynamically resize the image, this resizing will be done during every redraw and this will slow down Archi quite a lot and consume a lot of memory.
To void that, I'm working on developing my own cache. Once this is done, then I will be able to dynamically resize the images.
I'm not sure if I will finish before the end of the year. Else, it will be available early next year.
As an interim measure why not on load resize to icon expectations. Maybe this would negate own cache
I'm not sure to understand what your sentence means. My apologies.
The technical side:
My plugin is called by Archi when it needs to determine the filename that contains the icon. This means that the only thing my plugin does is to return the filename stated in the property if it exists, and the default filename if it doesn't.
I've got two options:
At the moment, I am thinking to a syntax like: folder/filename --> image full size folder/filename:width --> resize the image to the specified width, keeping the aspect ratio folder/filename:width:height --> resize the image to the specified width and height folder/filename:auto --> resize the image to the exact size of the element (when the element's size is changed, the image would be automatically resized at the same time)
Added tag icon and icon on models explorer changed to image but not diagram object. On some objects it changed the nature of image but reflection of original image. Properties showed image and had erratic behavior where properties content lost. One have to choose another object and come back to restore correct behavior