Leadtools.Windows.Annotations Requires Document/Medical license. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
DefaultPicture Property
See Also  Example
Leadtools.Windows.Annotations Namespace > AnnAudioObject Class : DefaultPicture Property



Gets or sets the default picture used by all AnnAudioObject objects.

Syntax

Visual Basic (Declaration) 
Public Shared Property DefaultPicture As AnnPicture
Visual Basic (Usage)Copy Code
Dim value As AnnPicture
 
AnnAudioObject.DefaultPicture = value
 
value = AnnAudioObject.DefaultPicture
C# 
public static AnnPicture DefaultPicture {get; set;}
C++/CLI 
public:
static property AnnPicture^ DefaultPicture {
   AnnPicture^ get();
   void set (AnnPicture^ value);
}

Return Value

An AnnPicture class that defines the picture used by the AnnAudioObject.

Example

Visual BasicCopy Code
Public Sub AnnAudioObject_DefaultPicture(ByVal container As AnnContainer, ByVal viewer As BitmapSourceViewer, ByVal newAudioPicture As String)
   ' first add a new AnnAudioObject with the original picture
   Dim obj As AnnAudioObject = New AnnAudioObject()
   obj.Left = 100
   obj.Top = 100
   obj.Width = 100
   obj.Height = 100
   container.Children.Add(obj)
   MessageBox.Show("An audio object with the original picture")

   ' now change the picture to one of our own
   Dim picture As AnnPicture = New AnnPicture(New BitmapImage(New Uri(newAudioPicture)))
   AnnAudioObject.DefaultPicture = picture

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

   ' add another audio object
   obj = New AnnAudioObject()
   obj.Left = 100
   obj.Top = 210
   obj.Width = 100
   obj.Height = 100
   container.Children.Add(obj)

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

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

   ' add another audio object
   obj = New AnnAudioObject()
   obj.Left = 100
   obj.Top = 320
   obj.Width = 100
   obj.Height = 100
   container.Children.Add(obj)

   MessageBox.Show("An audio object with the original picture")
End Sub
C#Copy Code
public void AnnAudioObject_DefaultPicture(AnnContainer container, BitmapSourceViewer viewer, string newAudioPicture) 

   // first add a new AnnAudioObject with the original picture 
   AnnAudioObject obj = new AnnAudioObject(); 
   obj.Left = 100; 
   obj.Top = 100; 
   obj.Width = 100; 
   obj.Height = 100; 
   container.Children.Add(obj); 
   MessageBox.Show("An audio object with the original picture"); 
 
   // now change the picture to one of our own 
   AnnPicture picture = new AnnPicture(new BitmapImage(new Uri(newAudioPicture))); 
   AnnAudioObject.DefaultPicture = picture; 
 
   // at this point, all new AnnAudioObject objects will use this new picture 
 
   // add another audio object 
   obj = new AnnAudioObject(); 
   obj.Left = 100; 
   obj.Top = 210; 
   obj.Width = 100; 
   obj.Height = 100; 
   container.Children.Add(obj); 
 
   MessageBox.Show("An audio object with the new picture"); 
 
   // set the picture back to the original value 
   AnnAudioObject.UseOriginalPicture = true; 
 
   // add another audio object 
   obj = new AnnAudioObject(); 
   obj.Left = 100; 
   obj.Top = 320; 
   obj.Width = 100; 
   obj.Height = 100; 
   container.Children.Add(obj); 
 
   MessageBox.Show("An audio object with the original picture"); 
}

Remarks

Set the UseOriginalPicture property to true to revert back to the original picture.

Requirements

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

See Also

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