G
Guest
Hi
Thanks for taking the time to check this post. Any help/suggestions are
appreciated.
I have an owner drawn (GDI+) document generation application that is made up
of embedded objects. The document acts simply as a layout container and
delegates painting to the embedded items.
The document supports scaling and rotation of these items. This is handled
using transformations to hide to implementation of this functionality from
the embedded items.
The problem I am struggling to resolve is that some of the embedded items
give user feedback based on the position of the cursor (this is passed to the
paint method of the items). If the item has been rotated, it still stores
any internal hotspot coordinates in the none rotated form and the cursor
position no longer matches (it has no knowledge of the transformation).
ie ... the cursor triggers the hotspot feedback when it is placed on the
document in the place the hotspot would be without any rotation.
Is there a simple way to transpose the coordinates. I have the angle of
rotation, the origin and the start point .... I need the mouse position
relative to the item as if it had not been rotated.
Any ideas. Ideally, I would prefer not to have to do the maths the old
fashioned way, as I would like to support more transformations at a later
time.
Thanks for leaving your thoughts.
Thanks for taking the time to check this post. Any help/suggestions are
appreciated.
I have an owner drawn (GDI+) document generation application that is made up
of embedded objects. The document acts simply as a layout container and
delegates painting to the embedded items.
The document supports scaling and rotation of these items. This is handled
using transformations to hide to implementation of this functionality from
the embedded items.
The problem I am struggling to resolve is that some of the embedded items
give user feedback based on the position of the cursor (this is passed to the
paint method of the items). If the item has been rotated, it still stores
any internal hotspot coordinates in the none rotated form and the cursor
position no longer matches (it has no knowledge of the transformation).
ie ... the cursor triggers the hotspot feedback when it is placed on the
document in the place the hotspot would be without any rotation.
Is there a simple way to transpose the coordinates. I have the angle of
rotation, the origin and the start point .... I need the mouse position
relative to the item as if it had not been rotated.
Any ideas. Ideally, I would prefer not to have to do the maths the old
fashioned way, as I would like to support more transformations at a later
time.
Thanks for leaving your thoughts.