LEADTOOLS Support
Document
Document SDK Examples
HTML5 - Restrict AnnObject Position to AnnContainer
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, February 28, 2013 10:28:04 AM(UTC)
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
LEADTOOLS Support
Document
Document SDK Examples
HTML5 - Restrict AnnObject Position to AnnContainer
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.