Leadtools.Windows.Annotations Requires Document/Medical license. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
AnnImageObject Class
See Also  Members   Example 
Leadtools.Windows.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  
XAML Object Element Usage 

<AnnImageObject .../>

XAML Object Element Usage 

<AnnImageObject .../>

Example

For XAML example, refer to AnnHotspotObject.

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(New BitmapImage(New Uri(imageFileName)))
  pic.TransparentMode = AnnPictureTransparentMode.None
  pic.TransparentColor = Colors.Black
  img.Picture = pic
  img.Left = 100
  img.Top = 200
  img.Width = 400
  img.Height = 600
  container.Children.Add(img)
End Sub
C#Copy Code
private void AnnImageObject_AnnImageObject(AnnContainer container, string imageFileName) 

   AnnImageObject img = new AnnImageObject(); 
   AnnPicture pic = new AnnPicture(new BitmapImage(new Uri(imageFileName))); 
   pic.TransparentMode = AnnPictureTransparentMode.None; 
   pic.TransparentColor = Colors.Black; 
   img.Picture = pic; 
   img.Left = 100; 
   img.Top = 200; 
   img.Width = 400; 
   img.Height = 600; 
   container.Children.Add(img); 
}

Remarks

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

The AnnStampObject class inherits the AnnImageObject class and access the common AnnImageObject.Picture property through this inheritance. For more information, refer to Using Pictures in WPF Annotation Objects

Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         System.Windows.Media.Visual
            System.Windows.UIElement
               System.Windows.FrameworkElement
                  Leadtools.Windows.Annotations.AnnObjectBase
                     Leadtools.Windows.Annotations.AnnRectangleObject
                        Leadtools.Windows.Annotations.AnnImageObject
                           Leadtools.Windows.Annotations.AnnAudioObject
                           Leadtools.Windows.Annotations.AnnHotspotObject

Requirements

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

See Also

AnnImageObject requires a Document/Medical product license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features and Unlocking Special LEAD Features.