Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, June 16, 2013 3:33:18 PM(UTC)
wangbill18

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!
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, June 17, 2013 3:49:33 AM(UTC)
Maen Hasan

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)
wangbill18

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)
Maen Hasan

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)
wangbill18

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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.084 seconds.