Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.5.2
|
Leadtools.Annotations Namespace > AnnObject Class : InvalidRectangle Property |
public virtual Rectangle InvalidRectangle {get;}
'Declaration Public Overridable ReadOnly Property InvalidRectangle As Rectangle
This example will change an object's name and then re-paint it inside its container.
Imports Leadtools Imports Leadtools.Annotations Imports Leadtools.Codecs Imports Leadtools.WinForms Imports Leadtools.Drawing 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
using Leadtools; using Leadtools.Annotations; using Leadtools.Codecs; using Leadtools.WinForms; using Leadtools.Drawing; 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)); }