UIChanged Event

Summary
Optional delegate method for additional processing.
Syntax
C#
C++/CLI
public event EventHandler<MedicalViewerUIChangedEventArgs> UIChanged 
            public: 
event EventHandler<MedicalViewerUIChangedEventArgs^>^ UIChanged 
Event Data

The event handler receives an argument of type MedicalViewerUIChangedEventArgs containing data related to this event. The following MedicalViewerUIChangedEventArgs properties provide information specific to this event.

PropertyDescription
ActionState Gets the MedicalViewerActionStatus enumeration value that indicates the status of the action.
ActionType Gets the MedicalViewerActionType enumeration value that indicates the action that was applied.
CellIndex Gets the value that indicates the index of the cell to which the action has been applied.
SubCellIndex Gets the value that indicates the index of the sub-cell to which the action has been applied.
X Gets the value that indicates the X coordinate of the cursor.
Y Gets the value that indicates the Y coordinate of the cursor.
Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.MedicalViewer; 
 
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 _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); 
 
 
      // Load an image and then add it to the control. 
      _image = _codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "image2.cmp"); 
      MedicalViewerMultiCell cell = new MedicalViewerMultiCell(); 
      _medicalViewer.Cells.Add(cell); 
 
      // add some actions that will be used to change the properties of the images inside the control. 
      cell.AddAction(MedicalViewerActionType.Scale); 
      cell.AddAction(MedicalViewerActionType.Offset); 
 
      // assign the added actions to a mouse button, meaning that when the user clicks and drags the mouse button, the associated action will be activated. 
      cell.SetAction(MedicalViewerActionType.Offset, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active); 
      cell.SetAction(MedicalViewerActionType.Scale, MedicalViewerMouseButtons.Middle, MedicalViewerActionFlags.Active); 
 
 
 
      Controls.Add(_medicalViewer); 
      _medicalViewer.Dock = DockStyle.Fill; 
 
      cell.PostPaint += new EventHandler<MedicalViewerPaintInformationEventArgs>(Viewer_PostPaint); 
      cell.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); 
   } 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.MedicalViewer Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.