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




Gets or sets the name offset relative to the upper left corner of the bounding rectangle of this AnnObject.

Syntax

Visual Basic (Declaration) 
Public Overridable Property NameOffset As AnnPoint
Visual Basic (Usage)Copy Code
Dim instance As AnnObject
Dim value As AnnPoint
 
instance.NameOffset = value
 
value = instance.NameOffset
C# 
public virtual AnnPoint NameOffset {get; set;}
Managed Extensions for C++ 
public: __property virtual AnnPoint get_NameOffset();
public: __property virtual void set_NameOffset( 
   AnnPoint value
);
C++/CLI 
public:
virtual property AnnPoint NameOffset {
   AnnPoint get();
   void set (AnnPoint value);
}

Return Value

The name offset relative to the upper left corner of the bounding rectangle of this AnnObject.

Example

This example sets the names of all objects in a container to be visible, at the upper-left corner of the image, and to have white text over a blue background with an Arial 11-point font.

Visual BasicCopy Code
Public Sub AnnObject_NameOffset(ByVal container As AnnContainer)
   Dim font As AnnFont = New AnnFont("Arial", New AnnLength(11, AnnUnit.Point), FontStyle.Regular)
   For Each obj As AnnObject In container.Objects
      obj.NameVisible = True
      obj.NameOffset = AnnPoint.Empty
      obj.NameForeColor = Color.White
      obj.NameBackColor = Color.Blue
      obj.NameFont = font
   Next obj
End Sub
C#Copy Code
public void AnnObject_NameOffset(AnnContainer container) 

   AnnFont font = new AnnFont("Arial", new AnnLength(11, AnnUnit.Point), FontStyle.Regular); 
   foreach(AnnObject obj in container.Objects) 
   { 
      obj.NameVisible = true; 
      obj.NameOffset = AnnPoint.Empty; 
      obj.NameForeColor = Color.White; 
      obj.NameBackColor = Color.Blue; 
      obj.NameFont = font; 
   } 
}

Remarks

The automation mode uses this property when you click and drag the name of an object around. Setting this property to an empty point, puts the name back at the upper left corner of the bounding rectangle of this AnnObject. For more information, refer to Annotation Object Names.

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