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;} |
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 Basic | Copy Code |
---|
Private Sub AnnObject_InvalidRectangle(ByVal obj As AnnObject, ByVal name As String, ByVal viewer As RasterImageViewer)
Dim rcOld As Rectangle = obj.InvalidRectangle
obj.Name = name
obj.NameVisible = True
obj.NameFont = New AnnFont("Arial", New AnnLength(10, AnnUnit.Point), FontStyle.Bold Or FontStyle.Italic)
Dim rcNew As Rectangle = obj.InvalidRectangle
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
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also