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



The AnnImageObject Class supports WPF/Silverlight.

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

Defines an annotation image object. Supported in Silverlight, Windows Phone 7

Object Model

AnnImageObject ClassAnnPicture Class

Syntax

Visual Basic (Declaration) 
Public Class AnnImageObject 
   Inherits AnnRectangleObject
   Implements IAnnHeaderIAnnImageIAnnObjectIAnnPictureIAnnRectangle 
Visual Basic (Usage)Copy Code
Dim instance As AnnImageObject
C# 
public class AnnImageObject : AnnRectangleObject, IAnnHeaderIAnnImageIAnnObjectIAnnPictureIAnnRectangle  
C++/CLI 
public ref class AnnImageObject : public AnnRectangleObject, IAnnHeaderIAnnImageIAnnObjectIAnnPictureIAnnRectangle  

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 = AnnTransparentMode.None
   pic.TransparentColor = Colors.Black
   img.Picture = pic
   img.Rect = New Rect(100, 200, 400, 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.TransparentColor = Colors.Black;
   pic.TransparentMode = AnnTransparentMode.None;
   img.Rect = new Rect(100, 200, 400, 600);
   img.Picture = pic;
   container.Children.Add(img);
}
SilverlightCSharpCopy Code
private void AnnImageObject_AnnImageObject(AnnContainer container, string imageFileName)
{
   AnnImageObject img = new AnnImageObject();
   AnnPicture pic = new AnnPicture(new BitmapImage(new Uri(imageFileName)));
   pic.TransparentColor = Colors.Black;
   pic.TransparentMode = AnnTransparentMode.None;
   img.Rect = new Rect(100, 200, 400, 600);
   img.Picture = pic;
   container.Children.Add(img);
}
SilverlightVBCopy 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.TransparentColor = Colors.Black
   pic.TransparentMode = AnnTransparentMode.None
   img.Rect = New Rect(100, 200, 400, 600)
   img.Picture = pic
   container.Children.Add(img)
End Sub

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
         Leadtools.Windows.Annotations.AnnObject
            Leadtools.Windows.Annotations.AnnRectangleObject
               Leadtools.Windows.Annotations.AnnImageObject
                  Leadtools.Windows.Annotations.AnnAudioObject
                  Leadtools.Windows.Annotations.AnnHotspotObject
                  Leadtools.Windows.Annotations.AnnVideoObject

Requirements

Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)

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.