This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Sunday, June 16, 2013 3:33:18 PM(UTC)
Groups: Registered
Posts: 50
I am using annautomation, when user try to move ann object, very often they ended up moving rotater. There is no need to rotate ann in my app, how to disable rotater to remove the confusion? Thanks!
#2
Posted
:
Monday, June 17, 2013 3:49:33 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
You can disable the rotation operation as follows:
1. Handle the AnnAutomation.BeforeObjectChanged event as follows:
+----------------+
AnnAutomation annAuto1;
AnnEditDesigner EditDesigner = null;
...
annAuto1.BeforeObjectChanged += new EventHandler<AnnBeforeObjectChangedEventArgs>(annAuto1_BeforeObjectChanged);
...
void annAuto1_BeforeObjectChanged(object sender, AnnBeforeObjectChangedEventArgs e)
{
AnnAutomation autiomation = null;
autiomation = (AnnAutomation)sender;
if ((autiomation.CurrentDesigner != null) && (autiomation.CurrentDesigner is AnnEditDesigner))
{
EditDesigner = (AnnEditDesigner)autiomation.CurrentDesigner;
EditDesigner.Edit +=new EventHandler<AnnEditDesignerEventArgs>(EditDesigner_Edit);
}
}
+----------------+
2. Handle the AnnEditDesigner.Edit event as follows:
+----------------+
void EditDesigner_Edit(object sender, AnnEditDesignerEventArgs e)
{
if (e.Operation == AnnEditDesignerOperation.Rotate)
{
e.Cancel = true;
}
}
+----------------+
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#3
Posted
:
Monday, June 17, 2013 2:17:59 PM(UTC)
Groups: Registered
Posts: 50
Hi, Your code disabled the roate, but it doesn't get rid of rotate control (a green line with two dots at ends). Easily I end up moving the roate control instead of actual annobject. Can the rotate control be removed? Thanks
#4
Posted
:
Tuesday, June 18, 2013 12:19:46 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
You can hide the rotation points by setting the Annobject.RotateCenter and Annobject.RotateGripper properties to large values as follows:
+--------------+
void annAuto1_BeforeObjectChanged(object sender, AnnBeforeObjectChangedEventArgs e)
{
AnnAutomation autiomation = null;
autiomation = (AnnAutomation)sender;
if ((autiomation.CurrentDesigner != null) && (autiomation.CurrentDesigner is AnnEditDesigner))
{
EditDesigner = (AnnEditDesigner)autiomation.CurrentDesigner;
EditDesigner.EditObject.RotateCenter = new AnnPoint(-1000000, -1000000);
EditDesigner.EditObject.RotateGripper = new AnnPoint(-1000000, -1000000);
rasterImageViewer1.Refresh();
EditDesigner.Edit +=new EventHandler(EditDesigner_Edit);
}
}
+--------------+
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#5
Posted
:
Tuesday, June 18, 2013 3:25:35 AM(UTC)
Groups: Registered
Posts: 50
Hi Maen, "setting the Annobject.RotateCenter and Annobject.RotateGripper properties to large values" worked. Thank you!
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.