LEADTOOLS Annotations (Leadtools.Annotations assembly)
LEAD Technologies, Inc

DefaultPicture Property (AnnAudioObject)

Example 





Gets or sets the default picture used by all AnnAudioObject objects.
Syntax
public static AnnPicture DefaultPicture {get; set;}
'Declaration
 
Public Shared Property DefaultPicture As AnnPicture
'Usage
 
Dim value As AnnPicture
 
AnnAudioObject.DefaultPicture = value
 
value = AnnAudioObject.DefaultPicture
public static AnnPicture DefaultPicture {get; set;}
 get_DefaultPicture();
set_DefaultPicture(value);
public:
static property AnnPicture^ DefaultPicture {
   AnnPicture^ get();
   void set (    AnnPicture^ value);
}

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
 
Public Sub AnnAudioObject_DefaultPicture(ByVal container As AnnContainer, ByVal viewer As RasterImageViewer, ByVal newAudioPicture As String)
   ' first add a new AnnAudioObject with the original picture
   Dim obj As AnnAudioObject = New AnnAudioObject()
   obj.Bounds = New AnnRectangle(100, 100, 100, 100)
   container.Objects.Add(obj)
   viewer.Invalidate()
   MessageBox.Show("An audio object with the original picture")

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

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

   ' add another audio object
   obj = New AnnAudioObject()
   obj.Bounds = New AnnRectangle(100, 210, 100, 100)
   container.Objects.Add(obj)
   viewer.Invalidate()

   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.Bounds = New AnnRectangle(100, 320, 100, 100)
   container.Objects.Add(obj)
   viewer.Invalidate()

   MessageBox.Show("An audio object with the original picture")
End Sub
public void AnnAudioObject_DefaultPicture(AnnContainer container, RasterImageViewer viewer, string newAudioPicture)
{
   // first add a new AnnAudioObject with the original picture
   AnnAudioObject obj = new AnnAudioObject();
   obj.Bounds = new AnnRectangle(100, 100, 100, 100);
   container.Objects.Add(obj);
   viewer.Invalidate();
   MessageBox.Show("An audio object with the original picture");

   // now change the picture to one of our own
   Image img = Image.FromFile(newAudioPicture);
   AnnPicture picture = new AnnPicture(img);
   AnnAudioObject.DefaultPicture = picture;

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

   // add another audio object
   obj = new AnnAudioObject();
   obj.Bounds = new AnnRectangle(100, 210, 100, 100);
   container.Objects.Add(obj);
   viewer.Invalidate();

   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.Bounds = new AnnRectangle(100, 320, 100, 100);
   container.Objects.Add(obj);
   viewer.Invalidate();

   MessageBox.Show("An audio object with the original picture");
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AnnAudioObject Class
AnnAudioObject Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.