SelectedCellsChanged Event

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

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

PropertyDescription
CellIndex Gets the value that indicates the index of the cell which has triggered the event. This value is only valid if the cell is add to the MedicalViewer.
SelectedCellsIndexes Gets an array of integer values that represents the indexes of the selected cells.
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 22.0.2023.2.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

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