Leadtools.Annotations Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
AnnImageObject Class
See Also  Members   Example 
Leadtools.Annotations Namespace : AnnImageObject Class



Defines an annotation image object.

Object Model















Syntax

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

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

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also

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