LEADTOOLS Annotations (Leadtools.Annotations assembly)

DefaultPicture Property (AnnVideoObject)

Show in webframe
Example 





Gets or sets the default picture used by all AnnVideoObject objects.
Syntax
public static AnnPicture DefaultPicture {get; set;}
'Declaration
 
Public Shared Property DefaultPicture As AnnPicture
'Usage
 
Dim value As AnnPicture
 
AnnVideoObject.DefaultPicture = value
 
value = AnnVideoObject.DefaultPicture

            

            
public:
static property AnnPicture^ DefaultPicture {
   AnnPicture^ get();
   void set (    AnnPicture^ value);
}

Property Value

An AnnPicture class that defines the picture used by the AnnVideoObject.
Remarks
Set the UseOriginalPicture property to true to revert back to the original picture.
Example
Copy Code  
Imports Leadtools
Imports Leadtools.Annotations
Imports Leadtools.Codecs
Imports Leadtools.WinForms

Public Sub AnnVideoObject_DefaultPicture(ByVal container As AnnContainer, ByVal viewer As RasterImageViewer, ByVal newVideoPicture As String)
   ' first add a new AnnVideoObject with the original picture
   Dim obj As New AnnVideoObject()
   obj.Bounds = New AnnRectangle(100, 100, 100, 100)
   container.Objects.Add(obj)
   viewer.Invalidate()
   MessageBox.Show("A video object with the original picture")

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

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

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

   MessageBox.Show("A video object with the new picture")

   ' set the picture back to the original value
   AnnVideoObject.UseOriginalPicture = True

   ' add another video object
   obj = New AnnVideoObject()
   obj.Bounds = New AnnRectangle(100, 320, 100, 100)
   container.Objects.Add(obj)
   viewer.Invalidate()

   MessageBox.Show("A video object with the original picture")
End Sub
using Leadtools;
using Leadtools.Annotations;
using Leadtools.Codecs;
using Leadtools.WinForms;

public void AnnVideoObject_DefaultPicture(AnnContainer container, RasterImageViewer viewer, string newVideoPicture)
{
   // first add a new AnnVideoObject with the original picture
   AnnVideoObject obj = new AnnVideoObject();
   obj.Bounds = new AnnRectangle(100, 100, 100, 100);
   container.Objects.Add(obj);
   viewer.Invalidate();
   MessageBox.Show("A video object with the original picture");

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

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

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

   MessageBox.Show("A video object with the new picture");

   // set the picture back to the original value
   AnnVideoObject.UseOriginalPicture = true;

   // add another video object
   obj = new AnnVideoObject();
   obj.Bounds = new AnnRectangle(100, 320, 100, 100);
   container.Objects.Add(obj);
   viewer.Invalidate();

   MessageBox.Show("A video object with the original picture");
}
Requirements

Target Platforms

See Also

Reference

AnnVideoObject Class
AnnVideoObject Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.