Leadtools.MedicalViewer Requires Medical Imaging license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
MedicalViewerUIChangedEventArgs Class
See Also  Members   Example 
Leadtools.MedicalViewer Namespace : MedicalViewerUIChangedEventArgs Class



The MedicalViewerUIChangedEventArgs class provides data for the MedicalViewer.UIChanged.

Syntax

Visual Basic (Declaration) 
Public Class MedicalViewerUIChangedEventArgs 
   Inherits EventArgs
Visual Basic (Usage)Copy Code
Dim instance As MedicalViewerUIChangedEventArgs
C# 
public class MedicalViewerUIChangedEventArgs : EventArgs 
C++/CLI 
public ref class MedicalViewerUIChangedEventArgs : public EventArgs 

Example

Visual BasicCopy Code
Public Sub CustomRectangleExample()
    Dim form As GetDispalyedClippedImageRectangleMainForm = New GetDispalyedClippedImageRectangleMainForm()
    form.ShowDialog()
End Sub

' MainForm1 will be the owner of the medical viewer control.
Private Class CustomRectangleMainForm : Inherits Form
    Public _medicalViewer As MedicalViewer

    Private Sub MedicalViewerForm_SizeChanged(ByVal sender As Object, ByVal e As EventArgs)
        _medicalViewer.Size = New Size(Me.ClientRectangle.Right, Me.ClientRectangle.Bottom)
    End Sub

    Public Sub New()
        RasterCodecs.Startup()
        Dim _codecs As RasterCodecs = New RasterCodecs()
        Dim _image As RasterImage

        ' Create the medical viewer and adjust some properties.
        _medicalViewer = New MedicalViewer()
        _medicalViewer.Rows = 2
        _medicalViewer.Columns = 1
        _medicalViewer.Location = New Point(0, 0)
        _medicalViewer.Size = New Size(Me.ClientRectangle.Right, Me.ClientRectangle.Bottom)


        ' add some action that will be used to change the properties of the images inside the control.
        _medicalViewer.AddAction(MedicalViewerActionType.Scale)
        _medicalViewer.AddAction(MedicalViewerActionType.Offset)

        ' assign the added actions to a mouse button, meaning that when the user click and drag the mouse button, the associted action will be activated.
        _medicalViewer.SetAction(MedicalViewerActionType.Offset, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active Or MedicalViewerActionFlags.RealTime)
        _medicalViewer.SetAction(MedicalViewerActionType.Scale, MedicalViewerMouseButtons.Middle, MedicalViewerActionFlags.Active Or MedicalViewerActionFlags.RealTime)

        ' Load an image and then add it to the control.
        _image = _codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path & "image2.cmp")
        _medicalViewer.Cells.Add(New MedicalViewerCell(_image, True, 1, 1))


        ' Load an image and then add it to the control.
        _image = _codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path & "image2.cmp")
        Dim cell As MedicalViewerCell = New MedicalViewerCell()
        _medicalViewer.Cells.Add(cell)

        RasterCodecs.Shutdown()
        Controls.Add(_medicalViewer)

        AddHandler _medicalViewer.PostPaint, AddressOf Viewer_PostPaint
        AddHandler _medicalViewer.UIChanged, AddressOf Viewer_UIChanged
    End Sub

    Private _color As Color
    Private Sub Viewer_UIChanged(ByVal sender As Object, ByVal e As MedicalViewerUIChangedEventArgs)
        If e.ActionType = MedicalViewerActionType.Offset Then
            If e.ActionState = MedicalViewerActionStatus.Progress Then
                _color = Color.Blue
            Else
                _color = Color.Yellow
            End If
        End If
    End Sub

    Private Sub Viewer_PostPaint(ByVal sender As Object, ByVal e As MedicalViewerPaintInformationEventArgs)
        e.Graphics.DrawRectangle(New Pen(_color), e.ImageRectangle)
    End Sub
End Class
C#Copy Code
public void CustomRectangleExample() 
      { 
   GetDispalyedClippedImageRectangleMainForm form = new GetDispalyedClippedImageRectangleMainForm(); 
   form.ShowDialog(); 
      } 
 
      // MainForm1 will be the owner of the medical viewer control. 
      class CustomRectangleMainForm : Form 
      { 
   public MedicalViewer _medicalViewer; 
 
   void MedicalViewerForm_SizeChanged(object sender, EventArgs e) 
   { 
       _medicalViewer.Size = new Size(this.ClientRectangle.Right, this.ClientRectangle.Bottom); 
   } 
 
   public CustomRectangleMainForm() 
   { 
       RasterCodecs.Startup(); 
       RasterCodecs _codecs = new RasterCodecs(); 
       RasterImage _image; 
 
       // Create the medical viewer and adjust some properties. 
       _medicalViewer = new MedicalViewer(); 
       _medicalViewer.Rows = 2; 
       _medicalViewer.Columns = 1; 
       _medicalViewer.Location = new Point(0, 0); 
       _medicalViewer.Size = new Size(this.ClientRectangle.Right, this.ClientRectangle.Bottom); 
 
 
       // add some action that will be used to change the properties of the images inside the control. 
       _medicalViewer.AddAction(MedicalViewerActionType.Scale); 
       _medicalViewer.AddAction(MedicalViewerActionType.Offset); 
 
       // assign the added actions to a mouse button, meaning that when the user click and drag the mouse button, the associted action will be activated. 
       _medicalViewer.SetAction(MedicalViewerActionType.Offset, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active | MedicalViewerActionFlags.RealTime); 
       _medicalViewer.SetAction(MedicalViewerActionType.Scale, MedicalViewerMouseButtons.Middle, MedicalViewerActionFlags.Active | MedicalViewerActionFlags.RealTime); 
 
       // Load an image and then add it to the control. 
       _image = _codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "image2.cmp"); 
       _medicalViewer.Cells.Add(new MedicalViewerCell(_image, true, 1, 1)); 
 
 
       // Load an image and then add it to the control. 
       _image = _codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "image2.cmp"); 
       MedicalViewerCell cell = new MedicalViewerCell(); 
       _medicalViewer.Cells.Add(cell); 
 
       RasterCodecs.Shutdown(); 
       Controls.Add(_medicalViewer); 
 
       _medicalViewer.PostPaint += new EventHandler<MedicalViewerPaintInformationEventArgs>(Viewer_PostPaint); 
       _medicalViewer.UIChanged += new EventHandler<MedicalViewerUIChangedEventArgs>(Viewer_UIChanged); 
   } 
 
   Color _color; 
   void Viewer_UIChanged(object sender, MedicalViewerUIChangedEventArgs e) 
   { 
       if (e.ActionType == MedicalViewerActionType.Offset) 
       { 
           if (e.ActionState == MedicalViewerActionStatus.Progress) 
               _color = Color.Blue; 
           else 
               _color = Color.Yellow; 
       } 
   } 
 
   void Viewer_PostPaint(object sender, MedicalViewerPaintInformationEventArgs e) 
   { 
       e.Graphics.DrawRectangle(new Pen(_color), e.ImageRectangle); 
   } 
      }

Inheritance Hierarchy

System.Object
   System.EventArgs
      Leadtools.MedicalViewer.MedicalViewerUIChangedEventArgs

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Leadtools.MedicalViewer requires a Medical Imaging license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features