public MedicalViewerActionType ActionType { get; }
public:
property MedicalViewerActionType ActionType {
MedicalViewerActionType get();
}
MedicalViewerActionType enumeration that indicates the action that was applied.
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);
}
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document