Plays the AnnAudioObject object that is currently being edited (selected) in this AnnAutomation.
public virtual void PlayAudio() Public Overridable Sub PlayAudio()
public:virtual void PlayAudio();
AnnAutomation can play one or more AnnAudioObject if they are currently in edit mode (selected) and the value of the CanPlay property is true.
Use the CanPlayAudio property to determine whether you can call this method.
using Leadtools;using Leadtools.Annotations;using Leadtools.WinForms;using Leadtools.Drawing;public void AnnAutomation_PlayAudio(AnnAutomation automation, string audioFilename){// make sure no objects are selectedautomation.SelectNone();// see if we can play audio (should say no)if (!automation.CanPlayAudio)MessageBox.Show("Cannot play audio");// add an audio object and select itAnnAudioObject audio = new AnnAudioObject();audio.Bounds = new AnnRectangle(100, 100, 200, 200, AnnUnit.Pixel);automation.Container.Objects.Add(audio);automation.StartEditing(audio, false);// see if we can play audio// (should say no, since the audio object does not have an audio file in the filename yet)if (!automation.CanPlayAudio)MessageBox.Show("Cannot play audio");// set up the filename for this audio objectaudio.FileName = audioFilename;// see if we can play audio (should play it now)if (automation.CanPlayAudio)automation.PlayAudio();}
Imports LeadtoolsImports Leadtools.AnnotationsImports Leadtools.WinFormsImports Leadtools.DrawingPublic Sub AnnAutomation_PlayAudio(ByVal automation As AnnAutomation, ByVal audioFilename As String)' make sure no objects are selectedautomation.SelectNone()' see if we can play audio (should say no)If (Not automation.CanPlayAudio) ThenMessageBox.Show("Cannot play audio")End If' add an audio object and select itDim audio As AnnAudioObject = New AnnAudioObject()audio.Bounds = New AnnRectangle(100, 100, 200, 200, AnnUnit.Pixel)automation.Container.Objects.Add(audio)automation.StartEditing(audio, False)' see if we can play audio' (should say no, since the audio object does not have an audio file in the filename yet)If (Not automation.CanPlayAudio) ThenMessageBox.Show("Cannot play audio")End If' set up the filename for this audio objectaudio.FileName = audioFilename' see if we can play audio (should play it now)If automation.CanPlayAudio Thenautomation.PlayAudio()End IfEnd Sub
|
Products |
Support |
Feedback: PlayAudio Method - Leadtools.Annotations |
Introduction |
Help Version 19.0.2017.6.20
|

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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.