Leadtools.Annotations Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
InvalidRectangle Property
See Also  Example
Leadtools.Annotations Namespace > AnnObject Class : InvalidRectangle Property




Gets the physical bounding rectangle of this AnnObject.

Syntax

Visual Basic (Declaration) 
Public Overridable ReadOnly Property InvalidRectangle As Rectangle
Visual Basic (Usage)Copy Code
Dim instance As AnnObject
Dim value As Rectangle
 
value = instance.InvalidRectangle
C# 
public virtual Rectangle InvalidRectangle {get;}
Managed Extensions for C++ 
public: __property virtual Rectangle get_InvalidRectangle();
C++/CLI 
public:
virtual property Rectangle InvalidRectangle {
   Rectangle get();
}

Return Value

The physical bounding rectangle of this AnnObject.

Example

This example will change an object's name and then re-paint it inside its container.

Visual BasicCopy Code
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
C#Copy Code
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)); 
}

Remarks

(Read only) This method returns the physical bounding rectangle of this AnnObject. This bounding rectangle consists of the union of the following rectangles:
  • The bounding rectangle of the graphics path returned from the GetGraphicsPath method with a AnnGetGraphicsPathMode value of Bound. This rectangle is then transformed using the PhysicalTransform matrix to convert the rectangle to physical coordinates. Finally this rectangle is adjusted by the physical width of the pen used to draw this object.
  • The physical bounding rectangle of the locked picture if this object is locked. Refer to Lock, LockPicture.
  • The physical bounding rectangle of the name text if the name of this AnnObject is visible. Refer to Name, NameFont, NameOffset and NameVisible.
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.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Leadtools.Annotations requires a Document or Medical toolkit license and unlock key. For more information, refer to: Raster Pro/Document/Medical Features