publiceventEventHandler<MedicalViewerAnimationInformationEventArgs> AnimationStarted
PublicEventAnimationStartedAsEventHandler(Of MedicalViewerAnimationInformationEventArgs)
public:
eventEventHandler
^ AnimationStarted
The event handler receives an argument of typeMedicalViewerAnimationInformationEventArgscontaining data related to this event. The followingMedicalViewerAnimationInformationEventArgsproperties provide information specific to this event.
Property | Description |
---|---|
CellIndex | Gets the value that indicates the index of the cell which has its animation engine started or stopped. This value is only valid if the cell is add to theMedicalViewer. |
usingLeadtools;
usingLeadtools.Codecs;
usingLeadtools.MedicalViewer;
classMedicalViewerForm : Form
{
privateMedicalViewer _medicalViewer;
publicMedicalViewerForm()
{
RasterCodecs _codecs =newRasterCodecs();
RasterImage _image;
// 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.
_image = _codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"xa.dcm"));
MedicalViewerMultiCell cell =newMedicalViewerMultiCell(_image,true, 1,1);
// add some actions that will be used to change the properties of the images inside the control.
细胞。AddAction(MedicalViewerActionType.WindowLevel);
细胞。AddAction(MedicalViewerActionType.Alpha);
细胞。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.
细胞。SetAction(MedicalViewerActionType.WindowLevel, MedicalViewerMouseButtons.Left, MedicalViewerActionFlags.Active);
细胞。SetAction(MedicalViewerActionType.Alpha, MedicalViewerMouseButtons.Middle, MedicalViewerActionFlags.Active);
细胞。SetAction(MedicalViewerActionType.Offset, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active);
_medicalViewer.Cells.Add(cell);
// adjust some properties of the cell and add some tags.
细胞。MedicalViewerTagAlignment SetTag(2。TopLeft, MedicalViewerTagType.UserData,"EX. ID 230-36-5448");
细胞。SetTag(4, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame);
细胞。SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Scale);
细胞。MedicalViewerTagAlignment SetTag(2。BottomLeft, MedicalViewerTagType.WindowLevelData);
细胞。SetTag(1, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.FieldOfView);
MedicalViewerMultiCell cell1 =newMedicalViewerMultiCell(_image,true, 1,1);
// Load another image and then add it to the control.
_image = _codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"mr.dcm"));
_medicalViewer.Cells.Add(cell1);
// add some actions that will be used to change the properties of the images inside the control.
cell1.AddAction(MedicalViewerActionType.WindowLevel);
cell1.AddAction(MedicalViewerActionType.Alpha);
cell1.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.
cell1.SetAction(MedicalViewerActionType.WindowLevel, MedicalViewerMouseButtons.Left, MedicalViewerActionFlags.Active);
cell1.SetAction(MedicalViewerActionType.Alpha, MedicalViewerMouseButtons.Middle, MedicalViewerActionFlags.Active);
cell1.SetAction(MedicalViewerActionType.Offset, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active);
// adjust some properties of the cell and add some tags.
cell1.SetTag(2, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData,"EX. ID 230-36-5448");
cell1.SetTag(4, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame);
cell1.SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Scale);
cell1.SetTag(2, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.WindowLevelData);
cell1.SetTag(1, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.FieldOfView);
Controls.Add(_medicalViewer);
_medicalViewer.Dock = DockStyle.Fill;
}
publicMedicalViewer Viewer
{
get{return_medicalViewer; }
}
}
MedicalViewerForm GetMedicalControl()
{
returnnewMedicalViewerForm();
}
// This example notifies the user when the animation has started or stopped using the AtartAnimation and StopAnimation procedures.
publicvoidMedicalViewerAnimationInformationExample()
{
MedicalViewerForm myForm = GetMedicalControl();
MedicalViewer medicalViewer = myForm.Viewer;
MedicalViewerMultiCell cell1 = (MedicalViewerMultiCell)(medicalViewer.Cells[0]);
cell1.AnimationStarted +=newEventHandler
(medicalViewer_AnimationStarted); cell1.AnimationStopped +=newEventHandler
(medicalViewer_AnimationStopped); cell1.Animation.Animated =true;
cell1.Animation.Animated =false;
myForm.ShowDialog();
}
voidmedicalViewer_AnimationStopped(objectsender, MedicalViewerAnimationInformationEventArgs e)
{
MessageBox.Show("Animation has stopped");
}
voidmedicalViewer_AnimationStarted(objectsender, MedicalViewerAnimationInformationEventArgs e)
{
MessageBox.Show("Animation has started");
}
staticclassLEAD_VARS
{
publicconststringImagesDir =@"C:\LEADTOOLS21\Resources\Images";
}
ImportsLeadtools
ImportsLeadtools.Codecs
ImportsLeadtools.MedicalViewer
PrivateClassMedicalViewerForm :InheritsForm
Private_medicalViewerAsMedicalViewer
PublicSubNew()
Dim_codecsAsRasterCodecs =NewRasterCodecs()
Dim_imageAsRasterImage
' 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.
_image = _codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"xa.dcm"))
DimcellAsMedicalViewerMultiCell =NewMedicalViewerMultiCell(_image,True, 1,1)
' add some actions that will be used to change the properties of the images inside the control.
细胞。AddAction(MedicalViewerActionType.WindowLevel)
细胞。AddAction(MedicalViewerActionType.Alpha)
细胞。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.
细胞。SetAction(MedicalViewerActionType.WindowLevel, MedicalViewerMouseButtons.Left, MedicalViewerActionFlags.Active)
细胞。SetAction(MedicalViewerActionType.Alpha, MedicalViewerMouseButtons.Middle, MedicalViewerActionFlags.Active)
细胞。SetAction(MedicalViewerActionType.Offset, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active)
_medicalViewer.Cells.Add(cell)
' adjust some properties of the cell and add some tags.
细胞。MedicalViewerTagAlignment SetTag(2。TopLeft, MedicalViewerTagType.UserData,"EX. ID 230-36-5448")
细胞。SetTag(4, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame)
细胞。SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Scale)
细胞。MedicalViewerTagAlignment SetTag(2。BottomLeft, MedicalViewerTagType.WindowLevelData)
细胞。SetTag(1, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.FieldOfView)
Dimcell1AsMedicalViewerMultiCell =NewMedicalViewerMultiCell(_image,True, 1,1)
' Load another image and then add it to the control.
_image = _codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"mr.dcm"))
_medicalViewer.Cells.Add(cell1)
' add some actions that will be used to change the properties of the images inside the control.
cell1.AddAction(MedicalViewerActionType.WindowLevel)
cell1.AddAction(MedicalViewerActionType.Alpha)
cell1.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.
cell1.SetAction(MedicalViewerActionType.WindowLevel, MedicalViewerMouseButtons.Left, MedicalViewerActionFlags.Active)
cell1.SetAction(MedicalViewerActionType.Alpha, MedicalViewerMouseButtons.Middle, MedicalViewerActionFlags.Active)
cell1.SetAction(MedicalViewerActionType.Offset, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active)
' adjust some properties of the cell and add some tags.
cell1.SetTag(2, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.UserData,"EX. ID 230-36-5448")
cell1.SetTag(4, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Frame)
cell1.SetTag(6, MedicalViewerTagAlignment.TopLeft, MedicalViewerTagType.Scale)
cell1.SetTag(2, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.WindowLevelData)
cell1.SetTag(1, MedicalViewerTagAlignment.BottomLeft, MedicalViewerTagType.FieldOfView)
Controls.Add(_medicalViewer)
_medicalViewer.Dock = DockStyle.Fill
EndSub
PublicReadOnlyPropertyViewer()AsMedicalViewer
Get
Return_medicalViewer
EndGet
EndProperty
EndClass
PrivateFunctionGetMedicalControl()AsMedicalViewerForm
ReturnNewMedicalViewerForm()
EndFunction
' This example notifies the user when the animation has started or stopped using the AtartAnimation and StopAnimation procedures.
_ PublicSubMedicalViewerAnimationInformationExample()
DimmyFormAsMedicalViewerForm = GetMedicalControl()
DimmedicalViewerAsMedicalViewer = myForm.Viewer
Dimcell1AsMedicalViewerMultiCell =CType(medicalViewer.Cells(0), MedicalViewerMultiCell)
AddHandlercell1.AnimationStarted,AddressOfmedicalViewer_AnimationStarted
AddHandlercell1.AnimationStopped,AddressOfmedicalViewer_AnimationStopped
cell1.Animation.Animated =True
cell1.Animation.Animated =False
myForm.ShowDialog()
EndSub
PrivateSubmedicalViewer_AnimationStopped(ByValsenderAsObject,ByValeAsMedicalViewerAnimationInformationEventArgs)
MessageBox.Show("Animation has stopped")
EndSub
PrivateSubmedicalViewer_AnimationStarted(ByValsenderAsObject,ByValeAsMedicalViewerAnimationInformationEventArgs)
MessageBox.Show("Animation has started")
EndSub
PublicNotInheritableClassLEAD_VARS
PublicConstImagesDirAsString="C:\LEADTOOLS21\Resources\Images"
EndClass
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
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.