publicMedicalViewerSpyGlassSpyGlass {get; }
PublicReadOnlyPropertySpyGlassAsMedicalViewerSpyGlass
public:
propertyMedicalViewerSpyGlass^SpyGlass {
MedicalViewerSpyGlass^get();
}
MedicalViewerSpyGlassclass that contains the properties that control the spy glass style and shape.
usingLeadtools;
usingLeadtools.Dicom;
usingLeadtools.Medical3D;
usingLeadtools.Codecs;
usingLeadtools.MedicalViewer;
usingLeadtools.ImageProcessing;
usingLeadtools.ImageProcessing.Core;
usingLeadtools.ImageProcessing.Color;
usingLeadtools.Annotations.Engine;
usingLeadtools.Annotations.Designers;
classMedicalViewerSpyGlassForm : Form
{
privateMedicalViewer_medicalViewer;
voidMedicalViewerLocalizer_SizeChanged(objectsender, EventArgs e)
{
_medicalViewer.Size =newSize(this.ClientRectangle.Right,this.ClientRectangle.Bottom);
}
publicMedicalViewerSpyGlassForm()
{
DicomEngine.Startup();
RasterCodecs _codecs =newRasterCodecs();
this.SizeChanged +=newEventHandler(MedicalViewerLocalizer_SizeChanged);
// Create the medical viewer and adjust the size and the location.
_medicalViewer =newMedicalViewer(1, 2);
_medicalViewer.Location =newPoint(0, 0);
_medicalViewer.Size =newSize(this.ClientRectangle.Right,this.ClientRectangle.Bottom);
// Load an image and then add it to the control.
RasterImage _image = _codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"xa.dcm"));
MedicalViewerMultiCell cell =newMedicalViewerMultiCell(_image,true, 1, 1);
cell.FitImageToCell =false;
// 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);
cell.AddAction(MedicalViewerActionType.SpyGlass);
// 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.Scale, MedicalViewerMouseButtons.Middle, MedicalViewerActionFlags.Active);
cell.SetAction(MedicalViewerActionType.Offset, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active);
cell.SetAction(MedicalViewerActionType.SpyGlass, MedicalViewerMouseButtons.Left, MedicalViewerActionFlags.Active);
cell.SpyGlassStarted +=newEventHandler
(cell_SpyGlassStarted); // adjust some spy glass properties.
cell.SpyGlass.PositionText = MedicalViewerSpyGlassTextType.Actual;
cell.SpyGlass.ZoomText = MedicalViewerSpyGlassTextType.Percentage;
cell.SpyGlass.ZoomOnScroll =true;
_medicalViewer.Cells.Add(cell);
// adjust some properties of the cell and add some tags.
_medicalViewer.Cells[0].SetTag(2, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData,"EX. ID 230-36-5448");
_medicalViewer.Cells[0].SetTag(4, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame);
_medicalViewer.Cells[0].SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Scale);
_medicalViewer.Cells[0].SetTag(2, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.WindowLevelData);
_medicalViewer.Cells[0].SetTag(1, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.FieldOfView);
cell.ScaleType = MedicalViewerScaleType.Dynamic;
Controls.Add(_medicalViewer);
_medicalViewer.Dock = DockStyle.Fill;
DicomEngine.Shutdown();
}
voidcell_SpyGlassStarted(objectsender, MedicalViewerSpyGlassStartedEventArgs e)
{
if(e.Image !=null)
{
Leadtools.ImageProcessing.Color.InvertCommand invert =newLeadtools.ImageProcessing.Color.InvertCommand();
invert.Run(e.Image);
}
}
voidMedicalViewerLocalizer_FormClosing(objectsender, FormClosingEventArgs e)
{
}
publicMedicalViewerViewer
{
get{return_medicalViewer; }
}
}
MedicalViewerSpyGlassForm GetMedicalViewerSpyGlassForm()
{
MessageBox.Show("Hold down Left click to show the spy glass, \n move the mouse while you hold the mouse button down to move the spy glass. \n scroll while holding the mouse down to zoom in or out");
returnnewMedicalViewerSpyGlassForm();
}
// This example changes the default window level value by decrease the width by 100. Then resets the images based on the new value.
publicvoidMedicalViewerSpyGlassExample()
{
MedicalViewerSpyGlassForm myForm = GetMedicalViewerSpyGlassForm();
MedicalViewermedicalViewer = myForm.Viewer;
myForm.ShowDialog();
}
staticclassLEAD_VARS
{
publicconststringImagesDir =@"C:\LEADTOOLS21\Resources\Images";
}
ImportsLeadtools
ImportsLeadtools.Dicom
ImportsLeadtools.Medical3D
ImportsLeadtools.Codecs
ImportsLeadtools.MedicalViewer
ImportsLeadtools.Annotations.Engine
ImportsLeadtools.Annotations.Designers
ImportsLeadtools.ImageProcessing.Core
PrivateClassMedicalViewerSpyGlassForm :InheritsForm
Private_medicalViewerAsMedicalViewer
PrivateSubMedicalViewer_SizeChanged(ByValsenderAsObject,ByValeAsEventArgs)
_medicalViewer.Size =NewSize(Me.ClientRectangle.Right,Me.ClientRectangle.Bottom)
EndSub
PublicSubNew()
DicomEngine.Startup()
Dim_codecsAsRasterCodecs =NewRasterCodecs()
AddHandlerSizeChanged,AddressOfMedicalViewer_SizeChanged
' Create the medical viewer and adjust the size and the location.
_medicalViewer =NewMedicalViewer(1, 2)
_medicalViewer.Location =NewPoint(0, 0)
_medicalViewer.Size =NewSize(Me.ClientRectangle.Right,Me.ClientRectangle.Bottom)
' Load an image and then add it to the control.
Dim_imageAsRasterImage = _codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"xa.dcm"))
DimcellAsMedicalViewerMultiCell =NewMedicalViewerMultiCell(_image,True, 1, 1)
cell.FitImageToCell =False
“添加一些将被用来改变的行动properties of the images inside the control.
cell.AddAction(MedicalViewerActionType.Scale)
cell.AddAction(MedicalViewerActionType.Offset)
cell.AddAction(MedicalViewerActionType.SpyGlass)
' 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.Scale, MedicalViewerMouseButtons.Middle, MedicalViewerActionFlags.Active)
cell.SetAction(MedicalViewerActionType.Offset, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active)
cell.SetAction(MedicalViewerActionType.SpyGlass, MedicalViewerMouseButtons.Left, MedicalViewerActionFlags.Active)
AddHandlercell.SpyGlassStarted,AddressOfcell_SpyGlassStarted
' adjust some spy glass properties.
cell.SpyGlass.PositionText = MedicalViewerSpyGlassTextType.Actual
cell.SpyGlass.ZoomText = MedicalViewerSpyGlassTextType.Percentage
cell.SpyGlass.ZoomOnScroll =True
_medicalViewer.Cells.Add(cell)
' adjust some properties of the cell and add some tags.
_medicalViewer.Cells(0)。SetTag(2, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData,"EX. ID 230-36-5448")
_medicalViewer.Cells(0)。MedicalViewerTag SetTag (4Alignment.TopLeft, MedicalViewerTagType.Frame)
_medicalViewer.Cells(0)。SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Scale)
_medicalViewer.Cells(0)。SetTag(2, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.WindowLevelData)
_medicalViewer.Cells(0)。SetTag(1, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.FieldOfView)
cell.ScaleType = MedicalViewerScaleType.Dynamic
Controls.Add(_medicalViewer)
_medicalViewer.Dock = DockStyle.Fill
DicomEngine.Shutdown()
EndSub
PrivateSubcell_SpyGlassStarted(ByValsenderAsObject,ByValeAsMedicalViewerSpyGlassStartedEventArgs)
IfNote.ImageIsNothingThen
DiminvertAsLeadtools.ImageProcessing.Color.InvertCommand =NewLeadtools.ImageProcessing.Color.InvertCommand()
invert.Run(e.Image)
EndIf
EndSub
PrivateSubMedicalViewerLocalizer_FormClosing(ByValsenderAsObject,ByValeAsFormClosingEventArgs)
EndSub
PublicReadOnlyPropertyViewer()AsMedicalViewer
Get
Return_medicalViewer
EndGet
EndProperty
EndClass
PrivateFunctionGetMedicalViewerSpyGlassForm()AsMedicalViewerSpyGlassForm
MessageBox.Show("Hold down Left click to show the spy glass, "& Constants.vbLf &" move the mouse while you hold the mouse button down to move the spy glass. "& Constants.vbLf &" scroll while holding the mouse down to zoom in or out")
ReturnNewMedicalViewerSpyGlassForm()
EndFunction
' This example changes the default window level value by decrease the width by 100. Then resets the images based on the new value.
_ PublicSubMedicalViewerSpyGlassExample()
DimmyFormAsMedicalViewerSpyGlassForm = GetMedicalViewerSpyGlassForm()
DimmedicalViewerAsMedicalViewer= myForm.Viewer
myForm.ShowDialog()
EndSub
PublicNotInheritableClassLEAD_VARS
PublicConstImagesDirAsString="C:\LEADTOOLS21\Resources\Images"
EndClass
帮助科尔ections
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
188宝金博怎么下载
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
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.