←Select platform

DefaultPicture Property

Summary

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

Syntax

C#
VB
C++
public static AnnPicture DefaultPicture { get; set; } 
  
Public Shared Property DefaultPicture As Leadtools.Windows.Annotations.AnnPicture 
public: 
static property Leadtools.Windows.Annotations.AnnPicture^ DefaultPicture { 
   Leadtools.Windows.Annotations.AnnPicture^ get(); 
   void set (    Leadtools.Windows.Annotations.AnnPicture^ ); 
} 

Property Value

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

Remarks

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

Example

C#
VB
Silverlight C#
Silverlight VB
using Leadtools.Windows.Controls; 
using Leadtools.Windows.Annotations; 
using Leadtools.Demos; 
using Leadtools.Help; 
 
 
public void AnnAudioObject_DefaultPicture(AnnContainer container, ImageViewer viewer, string newAudioPicture) 
{ 
   // first add a new AnnAudioObject with the original picture 
   AnnAudioObject obj = new AnnAudioObject(); 
   obj.Rect = new Rect(100, 100, 100, 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.Rect = new Rect(100, 210, 100, 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.Rect = new Rect(100, 320, 100, 100); 
   container.Children.Add(obj); 
 
   MessageBox.Show("An audio object with the original picture"); 
} 
Imports Leadtools.Windows.Controls 
Imports Leadtools.Windows.Annotations 
 
Public Sub AnnAudioObject_DefaultPicture(ByVal container As AnnContainer, ByVal viewer As ImageViewer, ByVal newAudioPicture As String) 
   ' first add a new AnnAudioObject with the original picture 
   Dim obj As AnnAudioObject = New AnnAudioObject() 
   obj.Rect = New Rect(100, 100, 100, 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.Rect = New Rect(100, 210, 100, 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.Rect = New Rect(100, 320, 100, 100) 
   container.Children.Add(obj) 
 
   MessageBox.Show("An audio object with the original picture") 
End Sub 
using Leadtools.Windows.Controls; 
using Leadtools.Windows.Annotations; 
using Leadtools.Examples; 
//using Leadtools.Help; 
 
 
public void AnnAudioObject_DefaultPicture(AnnContainer container, ImageViewer viewer, string newAudioPicture) 
{ 
   // first add a new AnnAudioObject with the original picture 
   AnnAudioObject obj = new AnnAudioObject(); 
   obj.Rect = new Rect(100, 100, 100, 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.Rect = new Rect(100, 210, 100, 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.Rect = new Rect(100, 320, 100, 100); 
   container.Children.Add(obj); 
 
   MessageBox.Show("An audio object with the original picture"); 
} 
Imports Leadtools.Windows.Controls 
Imports Leadtools.Windows.Annotations 
'using Leadtools.Help; 
 
 
Public Sub AnnAudioObject_DefaultPicture(ByVal container As AnnContainer, ByVal viewer As ImageViewer, ByVal newAudioPicture As String) 
   ' first add a new AnnAudioObject with the original picture 
   Dim obj As AnnAudioObject = New AnnAudioObject() 
   obj.Rect = New Rect(100, 100, 100, 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.Rect = New Rect(100, 210, 100, 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.Rect = New Rect(100, 320, 100, 100) 
   container.Children.Add(obj) 
 
   MessageBox.Show("An audio object with the original picture") 
End Sub 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Windows.Annotations Assembly