Book a Demo

Author Topic: Object-coords on diagrams mapping to image-coords?  (Read 4129 times)

jaykay

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Object-coords on diagrams mapping to image-coords?
« 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  :)

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8090
  • Karma: +118/-20
    • View Profile
Re: Object-coords on diagrams mapping to image-coo
« Reply #1 on: January 12, 2009, 08:58:57 am »
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.

jaykay

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Object-coords on diagrams mapping to image-coo
« Reply #2 on: January 12, 2009, 06:40:30 pm »
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?!  :-?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8090
  • Karma: +118/-20
    • View Profile
Re: Object-coords on diagrams mapping to image-coo
« Reply #3 on: January 13, 2009, 09:02:07 am »
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)

jaykay

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Object-coords on diagrams mapping to image-coo
« Reply #4 on: January 13, 2009, 08:41:21 pm »
Thank you very much! This helped me a lot!

jaykay

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Object-coords on diagrams mapping to image-coo
« Reply #5 on: January 20, 2009, 09:36:53 pm »
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?


KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Object-coords on diagrams mapping to image-coo
« Reply #6 on: January 21, 2009, 09:35:49 am »
Quote
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.
The Sparx Team
[email protected]