AnimationStarted Event

Summary
Optional delegate method for additional processing.
Syntax
C#
VB
C++
publiceventEventHandler<MedicalViewerAnimationInformationEventArgs> AnimationStarted
PublicEventAnimationStartedAsEventHandler(Of MedicalViewerAnimationInformationEventArgs)
public:eventEventHandler^ AnimationStarted
Event Data

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.
Example
C#
VB
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";}
ImportsLeadtoolsImportsLeadtools.CodecsImportsLeadtools.MedicalViewerPrivateClassMedicalViewerForm :InheritsFormPrivate_medicalViewerAsMedicalViewerPublicSubNew()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.FillEndSubPublicReadOnlyPropertyViewer()AsMedicalViewerGetReturn_medicalViewerEndGetEndPropertyEndClassPrivateFunctionGetMedicalControl()AsMedicalViewerFormReturnNewMedicalViewerForm()EndFunction' This example notifies the user when the animation has started or stopped using the AtartAnimation and StopAnimation procedures. _PublicSubMedicalViewerAnimationInformationExample()DimmyFormAsMedicalViewerForm = GetMedicalControl()DimmedicalViewerAsMedicalViewer = myForm.ViewerDimcell1AsMedicalViewerMultiCell =CType(medicalViewer.Cells(0), MedicalViewerMultiCell)AddHandlercell1.AnimationStarted,AddressOfmedicalViewer_AnimationStartedAddHandlercell1.AnimationStopped,AddressOfmedicalViewer_AnimationStoppedcell1.Animation.Animated =Truecell1.Animation.Animated =FalsemyForm.ShowDialog()EndSubPrivateSubmedicalViewer_AnimationStopped(ByValsenderAsObject,ByValeAsMedicalViewerAnimationInformationEventArgs)MessageBox.Show("Animation has stopped")EndSubPrivateSubmedicalViewer_AnimationStarted(ByValsenderAsObject,ByValeAsMedicalViewerAnimationInformationEventArgs)MessageBox.Show("Animation has started")EndSubPublicNotInheritableClassLEAD_VARSPublicConstImagesDirAsString="C:\LEADTOOLS21\Resources\Images"EndClass
Requirements

Target Platforms

Leadtools.MedicalViewer Assembly
188金宝搏的网址客服|Support|Contact Us|Intellectual Property Notices
© 1991-2021LEAD Technologies, Inc.All Rights Reserved.