The ImageDirtyChanged Event is available in LEADTOOLS Document and Medical Imaging toolkits.
Occurs when the
ImageDirty value changes.
Syntax
Visual Basic (Declaration) | |
---|
Public Event ImageDirtyChanged As EventHandler |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As AnnAutomation
Dim handler As EventHandler
AddHandler instance.ImageDirtyChanged, handler |
Example
This example subscribes to the ImageDirtyChanged event of all automations in a manager, then proceeds to save the image as it changes.
Visual Basic | Copy Code |
---|
Public 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 = CType(IIf(TypeOf sender Is AnnAutomation, sender, Nothing), 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 |
C# | Copy Code |
---|
public 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!");
} |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7
See Also