LEADTOOLS Annotations (Leadtools.Annotations assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
AnnImageObject Class
See Also  Members  
Leadtools.Annotations Namespace : AnnImageObject Class



The AnnImageObject Class is available in LEADTOOLS Document and Medical Imaging toolkits.

Defines an annotation image object.

Object Model

AnnImageObject ClassAnnRectangle StructureAnnRectangle StructureAnnBrush ClassAnnContainer ClassAnnFont ClassAnnGroupObject ClassAnnFont ClassAnnPoint StructureAnnPoint StructureAnnPen ClassAnnPicture ClassAnnPoint StructureAnnPoint StructureAnnUnitConverter Class

Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class AnnImageObject 
   Inherits AnnRectangleObject
   Implements IAnnPictureObjectICloneableIDisposableISerializable 
Visual Basic (Usage)Copy Code
Dim instance As AnnImageObject
C++/CLI 
[SerializableAttribute()]
public ref class AnnImageObject : public AnnRectangleObject, IAnnPictureObjectICloneableIDisposableISerializable  

Example

This example creates a new image object with top, left at 100, 200, width, height of 400, 600 pixels and then adds it to a container.

Visual BasicCopy Code
Private Sub AnnImageObject_AnnImageObject(ByVal container As AnnContainer, ByVal imageFileName As String)
   Dim img As AnnImageObject = New AnnImageObject()
   Dim pic As AnnPicture = New AnnPicture(Image.FromFile(imageFileName))
   pic.TransparentMode = AnnPictureTransparentMode.None
   pic.TransparentColor = Color.Black
   img.Picture = pic
   img.Bounds = New AnnRectangle(100, 200, 400, 600, AnnUnit.Pixel)
   container.Objects.Add(img)
End Sub
C#Copy Code
private void AnnImageObject_AnnImageObject(AnnContainer container, string imageFileName)
{
   AnnImageObject img = new AnnImageObject();
   AnnPicture pic = new AnnPicture(Image.FromFile(imageFileName));
   pic.TransparentMode = AnnPictureTransparentMode.None;
   pic.TransparentColor = Color.Black;
   img.Picture = pic;
   img.Bounds = new AnnRectangle(100, 200, 400, 600, AnnUnit.Pixel);
   container.Objects.Add(img);
}

Remarks

The image annotation object is a raster image defined by a bounding rectangle. This object does not support pens or brushes.

The AnnAudioObject and the AnnHotspotObject classes inherit the AnnImageObject class and access the common AnnImageObject.Picture property through this inheritance. For more information, refer to Using Pictures in Annotation Objects

Inheritance Hierarchy

System.Object
   Leadtools.Annotations.AnnDrawable
      Leadtools.Annotations.AnnObject
         Leadtools.Annotations.AnnRectangleObject
            Leadtools.Annotations.AnnImageObject
               Leadtools.Annotations.AnnAudioObject
               Leadtools.Annotations.AnnHotspotObject
               Leadtools.Annotations.AnnVideoObject

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

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