Defines an audio annotation object.
public class AnnAudioObject : AnnImageObject
Public Class AnnAudioObject
Inherits Leadtools.Windows.Annotations.AnnImageObject
Implements Leadtools.Windows.Annotations.IAnnHeader, Leadtools.Windows.Annotations.IAnnImage, Leadtools.Windows.Annotations.IAnnObject, Leadtools.Windows.Annotations.IAnnPicture, Leadtools.Windows.Annotations.IAnnRectangle
The audio annotation object is a scaled image that can be activated to play an audio (WAV) clip. The WAV uri is stored in the Uri 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 Uri. 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 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.
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.
using Leadtools.Windows.Controls;
using Leadtools.Windows.Annotations;
using Leadtools.Demos;
using Leadtools.Help;
private void AnnAudioObject_AnnAudioObject(AnnContainer container, string waveFileName)
{
AnnAudioObject audio = new AnnAudioObject();
audio.Rect = new Rect(100, 200, 400, 600);
audio.Uri = waveFileName;
container.Children.Add(audio);
// play the audio to test it
if ((audio.CanPlay))
audio.Play();
}
Imports Leadtools.Windows.Controls
Imports Leadtools.Windows.Annotations
'''<!-- 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.Rect = New Rect(100, 200, 400, 600)
audio.Uri = waveFileName
container.Children.Add(audio)
' play the audio to test it
If ((audio.CanPlay)) Then
audio.Play()
End If
End Sub
using Leadtools.Windows.Controls;
using Leadtools.Windows.Annotations;
using Leadtools.Examples;
//using Leadtools.Help;
private void AnnAudioObject_AnnAudioObject(AnnContainer container, string waveFileName)
{
AnnAudioObject audio = new AnnAudioObject();
audio.Rect = new Rect(100, 200, 400, 600);
audio.Uri = waveFileName;
container.Children.Add(audio);
// play the audio to test it
if ((audio.CanPlay))
audio.Play();
}
Imports Leadtools.Windows.Controls
Imports Leadtools.Windows.Annotations
'using Leadtools.Help;
Private Sub AnnAudioObject_AnnAudioObject(ByVal container As AnnContainer, ByVal waveFileName As String)
Dim audio As AnnAudioObject = New AnnAudioObject()
audio.Rect = New Rect(100, 200, 400, 600)
audio.Uri = waveFileName
container.Children.Add(audio)
' play the audio to test it
If (audio.CanPlay) Then
audio.Play()
End If
End Sub
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET