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 : Thursday, February 28, 2013 10:28:04 AM(UTC)

JamesD  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Attached is a sample project that demonstrates how to restrict the position of an AnnObject to either the Image Viewer's boundaries or the AnnContainer's boundaries.

The project is based off the 'HTML5 AnnStampObject with Picture' example from our forums. The AnnObject is restricted by handling the AnnAutomation.Edit event. In the event handler, the x/y location of each point in the object is checked to see if it is within the bounds of the viewer's control size or the AnnContainer, depending on which SizeMode is used to display the image.

If a point in the AnnObject is found to be outside of the boundary, the locations for all the points in the object are set to the location of the object points from the previous Edit event. The event handler begins in TestAnn.htm, on line 120.

Primary Classes/Properties/Events Implemented In Project:

AnnAutomation.Edit Event-
http://www.leadtools.com/help/leadtools/v18/dh/javascript/aa/leadtools.annotations.automation~leadtools.annotations.automation.annautomation~edit_ev.html

AnnObject.Points Property -
http://www.leadtools.com/help/leadtools/v18/dh/javascript/ac/leadtools.annotations.core~leadtools.annotations.core.annobject~points.html
File Attachment(s):
AnnObject-Restrict-Bounds.zip (595kb) downloaded 81 time(s).
 

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.

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.060 seconds.