LEADTOOLS Annotations for WPF and Silverlight (Leadtools.Windows.Annotations assembly)

ImageDirtyChanged Event

Show in webframe
Example 





Occurs when the ImageDirty value changes.
Syntax
public event EventHandler ImageDirtyChanged
'Declaration
 
Public Event ImageDirtyChanged As EventHandler
'Usage
 
Dim instance As AnnAutomation
Dim handler As EventHandler
 
AddHandler instance.ImageDirtyChanged, handler

            

            
public:
event EventHandler^ ImageDirtyChanged
Remarks

This event will be fired after the ImageDirty value changes.

The Leadtools.Windows.Controls.ImageViewer.Source in the Viewer might change after calling any of the following methods:

You can use this event along with the ImageDirty property to update your application user interface.

Example
Copy Code  
Imports Leadtools.Windows.Controls
Imports Leadtools.Windows.Annotations

Private Sub AnnAutomation_ImageDirtyChanged(ByVal manager As AnnAutomationManager)
   ' subscribe to the ImageDirtyChanged event of all automations
   For Each automation As AnnAutomation In manager.Automations
      AddHandler automation.ImageDirtyChanged, AddressOf automation_ImageDirtyChanged
   Next automation
End Sub

Private Sub automation_ImageDirtyChanged(ByVal sender As Object, ByVal e As EventArgs)
   Dim automation As AnnAutomation = DirectCast(sender, AnnAutomation)
   If automation.ImageDirty Then
      MessageBox.Show("Image has changed and needs saving!")

      '
      ' add code to save the automation.Viewer.Image here
      '

      ' set the ImageDirty flag to false
      automation.ImageDirty = False
   Else
      MessageBox.Show("Image has been saved!")
   End If
End Sub
using Leadtools.Windows.Controls;
using Leadtools.Windows.Annotations;
using Leadtools.Demos;
using Leadtools.Help;

private void AnnAutomation_ImageDirtyChanged(AnnAutomationManager manager)
{
   // subscribe to the ImageDirtyChanged event of all automations
   foreach(AnnAutomation automation in manager.Automations)
      automation.ImageDirtyChanged += new EventHandler(automation_ImageDirtyChanged);
}

private void automation_ImageDirtyChanged(object sender, EventArgs e)
{
   AnnAutomation automation = sender as AnnAutomation;
   if(automation.ImageDirty)
   {
      MessageBox.Show("Image has changed and needs saving!");

      //
      // add code to save the automation.Viewer.Image here
      //

      // set the ImageDirty flag to false
      automation.ImageDirty = false;
   }
   else
      MessageBox.Show("Image has been saved!");
}
using Leadtools.Windows.Controls;
using Leadtools.Windows.Annotations;
using Leadtools.Examples;
using Leadtools.Silverlight.Demos;

private void AnnAutomation_ImageDirtyChanged(AnnAutomationManager manager)
{
   // subscribe to the ImageDirtyChanged event of all automations
   foreach(AnnAutomation automation in manager.Automations)
      automation.ImageDirtyChanged += new EventHandler(automation_ImageDirtyChanged);
}

private void automation_ImageDirtyChanged(object sender, EventArgs e)
{
   AnnAutomation automation = sender as AnnAutomation;
   if(automation.ImageDirty)
   {
      MessageBox.Show("Image has changed and needs saving!");

      //
      // add code to save the automation.Viewer.Image here
      //

      // set the ImageDirty flag to false
      automation.ImageDirty = false;
   }
   else
      MessageBox.Show("Image has been saved!");
}
Imports Leadtools.Windows.Controls
Imports Leadtools.Windows.Annotations
Imports Leadtools.Silverlight.Demos

Private Sub AnnAutomation_ImageDirtyChanged(ByVal manager As AnnAutomationManager)
   ' subscribe to the ImageDirtyChanged event of all automations
   For Each automation As AnnAutomation In manager.Automations
      AddHandler automation.ImageDirtyChanged, AddressOf automation_ImageDirtyChanged
   Next automation
End Sub

Private Sub automation_ImageDirtyChanged(ByVal sender As Object, ByVal e As EventArgs)
   Dim automation As AnnAutomation = TryCast(sender, AnnAutomation)
   If automation.ImageDirty Then
      MessageBox.Show("Image has changed and needs saving!")

      '
      ' add code to save the automation.Viewer.Image here
      '

      ' set the ImageDirty flag to false
      automation.ImageDirty = False
   Else
      MessageBox.Show("Image has been saved!")
   End If
End Sub
Requirements

Target Platforms

See Also

Reference

AnnAutomation Class
AnnAutomation Members

 

 


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