LEADTOOLS Annotations for WPF and Silverlight (Leadtools.Windows.Annotations assembly)
LEAD Technologies, Inc

DefaultPicture Property (AnnHotspotObject)

Example 





Gets or sets the default picture used by all AnnHotspotObject objects. .NET support Silverlight support
Syntax
public static AnnPicture DefaultPicture {get; set;}
'Declaration
 
Public Shared Property DefaultPicture As AnnPicture
'Usage
 
Dim value As AnnPicture
 
AnnHotspotObject.DefaultPicture = value
 
value = AnnHotspotObject.DefaultPicture
public static AnnPicture DefaultPicture {get; set;}
 get_DefaultPicture();
set_DefaultPicture(value);
public:
static property AnnPicture^ DefaultPicture {
   AnnPicture^ get();
   void set (    AnnPicture^ value);
}

Property Value

An AnnPicture class that defines the picture used by the AnnHotspotObject.
Remarks
Use UseOriginalPicture to revert back to the original picture.
Example
Copy CodeCopy Code  
Public Sub AnnHotspotObject_DefaultPicture(ByVal container As AnnContainer, ByVal viewer As ImageViewer, ByVal newHotspotPicture As String)
   ' first add a new AnnHotspotObject with the original picture
   Dim obj As AnnHotspotObject = New AnnHotspotObject()
   obj.Rect = New Rect(100, 100, 100, 100)
   container.Children.Add(obj)

   MessageBox.Show("An Hotspot object with the original picture")

   ' now change the picture to one of our own
   Dim img As BitmapSource = New BitmapImage(New Uri(newHotspotPicture))
   Dim picture As AnnPicture = New AnnPicture(img)
   AnnHotspotObject.DefaultPicture = picture

   ' at this point, all new AnnHotspotObject objects will use this new picture

   ' add another Hotspot object
   obj = New AnnHotspotObject()
   obj.Rect = New Rect(100, 210, 100, 100)

   container.Children.Add(obj)

   MessageBox.Show("An Hotspot object with the new picture")

   ' set the picture back to the original value
   AnnHotspotObject.UseOriginalPicture = True

   ' add another Hotspot object
   obj = New AnnHotspotObject()
   obj.Rect = New Rect(100, 320, 100, 100)
   container.Children.Add(obj)

   MessageBox.Show("An Hotspot object with the original picture")
End Sub
public void AnnHotspotObject_DefaultPicture(AnnContainer container, ImageViewer viewer, string newHotspotPicture)
{
   // first add a new AnnHotspotObject with the original picture
   AnnHotspotObject obj = new AnnHotspotObject();
   obj.Rect = new Rect(100, 100, 100, 100);
   container.Children.Add(obj);

   MessageBox.Show("An Hotspot object with the original picture");

   // now change the picture to one of our own
   BitmapSource img = new BitmapImage(new Uri(newHotspotPicture));
   AnnPicture picture = new AnnPicture(img);
   AnnHotspotObject.DefaultPicture = picture;

   // at this point, all new AnnHotspotObject objects will use this new picture

   // add another Hotspot object
   obj = new AnnHotspotObject();
   obj.Rect = new Rect(100, 210, 100, 100);

   container.Children.Add(obj);

   MessageBox.Show("An Hotspot object with the new picture");

   // set the picture back to the original value
   AnnHotspotObject.UseOriginalPicture = true;

   // add another Hotspot object
   obj = new AnnHotspotObject();
   obj.Rect = new Rect(100, 320, 100, 100);
   container.Children.Add(obj);

   MessageBox.Show("An Hotspot object with the original picture");
}
public void AnnHotspotObject_DefaultPicture(AnnContainer container, ImageViewer viewer, string newHotspotPicture)
{
   // first add a new AnnHotspotObject with the original picture
   AnnHotspotObject obj = new AnnHotspotObject();
   obj.Rect = new Rect(100, 100, 100, 100);
   container.Children.Add(obj);

   MessageBox.Show("An Hotspot object with the original picture");

   // now change the picture to one of our own
   BitmapSource img = new BitmapImage(new Uri(newHotspotPicture));
   AnnPicture picture = new AnnPicture(img);
   AnnHotspotObject.DefaultPicture = picture;

   // at this point, all new AnnHotspotObject objects will use this new picture

   // add another Hotspot object
   obj = new AnnHotspotObject();
   obj.Rect = new Rect(100, 210, 100, 100);

   container.Children.Add(obj);

   MessageBox.Show("An Hotspot object with the new picture");

   // set the picture back to the original value
   AnnHotspotObject.UseOriginalPicture = true;

   // add another Hotspot object
   obj = new AnnHotspotObject();
   obj.Rect = new Rect(100, 320, 100, 100);
   container.Children.Add(obj);

   MessageBox.Show("An Hotspot object with the original picture");
}
Public Sub AnnHotspotObject_DefaultPicture(ByVal container As AnnContainer, ByVal viewer As ImageViewer, ByVal newHotspotPicture As String)
   ' first add a new AnnHotspotObject with the original picture
   Dim obj As AnnHotspotObject = New AnnHotspotObject()
   obj.Rect = New Rect(100, 100, 100, 100)
   container.Children.Add(obj)

   MessageBox.Show("An Hotspot object with the original picture")

   ' now change the picture to one of our own
   Dim img As BitmapSource = New BitmapImage(New Uri(newHotspotPicture))
   Dim picture As AnnPicture = New AnnPicture(img)
   AnnHotspotObject.DefaultPicture = picture

   ' at this point, all new AnnHotspotObject objects will use this new picture

   ' add another Hotspot object
   obj = New AnnHotspotObject()
   obj.Rect = New Rect(100, 210, 100, 100)

   container.Children.Add(obj)

   MessageBox.Show("An Hotspot object with the new picture")

   ' set the picture back to the original value
   AnnHotspotObject.UseOriginalPicture = True

   ' add another Hotspot object
   obj = New AnnHotspotObject()
   obj.Rect = New Rect(100, 320, 100, 100)
   container.Children.Add(obj)

   MessageBox.Show("An Hotspot object with the original picture")
End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AnnHotspotObject Class
AnnHotspotObject Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.