The MedicalViewerUIChangedEventArgs class provides data for the UIChanged.
public class MedicalViewerUIChangedEventArgs : System.EventArgsPublic Class MedicalViewerUIChangedEventArgsInherits System.EventArgs
public ref class MedicalViewerUIChangedEventArgs : public System.EventArgs
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.MedicalViewer<TestMethod()> _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 FormPublic _medicalViewer As MedicalViewerPrivate Sub MedicalViewerForm_SizeChanged(ByVal sender As Object, ByVal e As EventArgs)_medicalViewer.Size = New Size(Me.ClientRectangle.Right, Me.ClientRectangle.Bottom)End SubPublic Sub New()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)' Load an image and then add it to the control._image = _codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "image2.cmp"))Dim cell As MedicalViewerMultiCell = 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.FillAddHandler cell.PostPaint, AddressOf Viewer_PostPaintAddHandler cell.UIChanged, AddressOf Viewer_UIChangedEnd SubPrivate _color As ColorPrivate Sub Viewer_UIChanged(ByVal sender As Object, ByVal e As MedicalViewerUIChangedEventArgs)If e.ActionType = MedicalViewerActionType.Offset ThenIf e.ActionState = MedicalViewerActionStatus.Progress Then_color = Color.BlueElse_color = Color.YellowEnd IfEnd IfEnd SubPrivate Sub Viewer_PostPaint(ByVal sender As Object, ByVal e As MedicalViewerPaintInformationEventArgs)e.Graphics.DrawRectangle(New Pen(_color), e.ImageRectangle)End SubEnd ClassPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
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);}}
|
Products |
Support |
Feedback: MedicalViewerUIChangedEventArgs Class - Leadtools.MedicalViewer |
Introduction |
Help Version 19.0.2017.3.24
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.