LEADTOOLS Annotations (Leadtools.Annotations assembly)
LEAD Technologies, Inc

InvalidRectangle Property (AnnObject)

Example 





Gets the physical bounding rectangle of this AnnObject.
Syntax
public virtual Rectangle InvalidRectangle {get;}
'Declaration
 
Public Overridable ReadOnly Property InvalidRectangle As Rectangle
'Usage
 
Dim instance As AnnObject
Dim value As Rectangle
 
value = instance.InvalidRectangle
public virtual Rectangle InvalidRectangle {get;}
 get_InvalidRectangle(); 
public:
virtual property Rectangle InvalidRectangle {
   Rectangle get();
}

Property Value

The physical bounding rectangle of this AnnObject.
Remarks
This method returns the physical bounding rectangle of this AnnObject. This bounding rectangle consists of the union of the following rectangles: This rectangle can be used to calculate the invalid region needed to re-paint this object inside its container. The annotation automation toolkit uses this value to speed up re-painting the owner control when an object changes position or appearance.
Example
 
Private Sub AnnObject_InvalidRectangle(ByVal obj As AnnObject, ByVal name As String, ByVal viewer As RasterImageViewer)
   ' first save the old invalid rectangle
   Dim rcOld As Rectangle = obj.InvalidRectangle
   ' set the name
   obj.Name = name
   obj.NameVisible = True
   obj.NameFont = New AnnFont("Arial", New AnnLength(10, AnnUnit.Point), FontStyle.Bold Or FontStyle.Italic)

   ' get the new invalid rectangle
   Dim rcNew As Rectangle = obj.InvalidRectangle

   ' re-paint this object by invalidating the union of both rectangles
   viewer.Invalidate(Rectangle.Union(rcOld, rcNew))
End Sub
private void AnnObject_InvalidRectangle(AnnObject obj, string name, RasterImageViewer viewer)
{
   // first save the old invalid rectangle
   Rectangle rcOld = obj.InvalidRectangle;
   // set the name
   obj.Name = name;
   obj.NameVisible = true;
   obj.NameFont = new AnnFont("Arial", new AnnLength(10, AnnUnit.Point), FontStyle.Bold | FontStyle.Italic);

   // get the new invalid rectangle
   Rectangle rcNew = obj.InvalidRectangle;

   // re-paint this object by invalidating the union of both rectangles
   viewer.Invalidate(Rectangle.Union(rcOld, rcNew));
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AnnObject Class
AnnObject Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.