Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: jaykay on January 09, 2009, 06:49:06 pm
-
Hi, I'm currently trying to figure out how EA transformes the coords of objects on diagrams when exporting them to an image.
I already had a look at the table t_diagramobjects (RectTop, RectLeft, ...) but when the diagram is quite large these values don't seem to fit anymore. The given scale and cx,cy Parameters in t_diagram don't help me either.
Does anybody have a clue how to tell where an object will appear (X,Y) after converting the diagram that contains it to an image?
Background is that we've written our own HTML-Generator and want to include this neat feature of <AREA> Tags, as in the "Documentation->HTML Report" function.
Any help kindly appreciated :)
-
The origin of the diagram is at the top left. x coordinates go up to the right, y coordinates go down (negative) when going down. Sizes are pixels at 100% zoom.
-
Thanks for your reply!
My problem is that if I got an object with the coordinates (17847, -7495,18459,-7707) then, according to your answer, this object will appear at (892, 374, 922, 385) on an exported .png image (assuming a scale factor of 5%).
But the object appears at (2606, 1097, 2695, 1127) so I think there must be some kind of further conversion/scaling going on?! :-?
-
For large bitmaps it will scale down the image to fit within the image memory limit (in uncompressed form) on the diagram page of the options.
Also, there may be an offset where the bounding rect of the diagram has been moved to the origin (plus room for border)
-
Thank you very much! This helped me a lot!
-
Another - maybe stupid - question:
How are the sizes of the borders in the right lower corner of the image determined? Those are only added when the diagram has been scaled.
After experimenting quite a few days, I'm really stuck.
Is this the offset mentioned in your post? How is this offset calculated?
-
Those are only added when the diagram has been scaled.
I don't know the answer to your question, but if you go "Tools > Options > Diagram" and look at the "Diagram Frames" option, you need to clear the "On Clipboard Images" option if you don't want a border on a saved or printed diagram if it is scaled, because the scaling process uses the clipboard.