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





Defines an audio annotation object.

Object Model





Syntax

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

<AnnAudioObject .../>

XAML Object Element Usage 

<AnnAudioObject .../>

Example

This example creates a new audio object at location 100, 200 and with dimensions of 400 x 600 and then adds it to a container.

Visual BasicCopy Code
'''<!-- This example creates a new audio object at location 100, 200 and with dimensions of 400 x 600 and then adds it to a container.-->
Private Sub AnnAudioObject_AnnAudioObject(ByVal container As AnnContainer, ByVal waveFileName As String)
   Dim audio As AnnAudioObject = New AnnAudioObject()
   audio.Left = 100
   audio.Top = 200
   audio.Width = 400
   audio.Height = 600
   audio.FileName = waveFileName
   container.Children.Add(audio)
   ' play the audio to test it
   If ((audio.CanPlay)) Then
      audio.Play()
   End If
End Sub
C#Copy Code
private void AnnAudioObject_AnnAudioObject(AnnContainer container, string waveFileName) 

   AnnAudioObject audio = new AnnAudioObject(); 
   audio.Left = 100; 
   audio.Top = 200; 
   audio.Width = 400; 
   audio.Height = 600; 
   audio.FileName = waveFileName; 
   container.Children.Add(audio); 
   // play the audio to test it 
   if((audio.CanPlay)) 
      audio.Play(); 
}

Remarks

The audio annotation object is a scaled image that can be activated to play an audio (WAV) clip. The WAV file path is stored in the FileName property, so the WAV data itself is not stored in this object, only the physical path. In automation mode, when this audio object is clicked, the framework will try to locate and then play the WAV file stored in FileName. This object will use the default image of an audio speaker. To change this default image, change the AnnImageObject.Picture value.

The AnnAudioObject class inherits the the AnnImageObject class and accesses the common AnnImageObject.Picture property mentioned above through this inheritance.

For more information about the audio annotation object refer to AnnAudioObject for WPF. For more information about the automated annotation audio object, refer to WPF Annotation Objects - Automated Features and WPF Automated Annotations - Audio Tab.

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

Requirements

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

See Also

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