Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, February 5, 2012 9:42:45 PM(UTC)
M.Shimase

Groups: Registered
Posts: 6


How can I know the MedicalViewerActionType assigned to the button of the mouse ?
I tried it with the following code.
but it is not work.
It become error.
Please advise me .


-----------------------------------------------------------------------------------------------------------------
private MedicalViewerActionType GetMouseActionType(ref MedicalViewerMultiCell cell, MedicalViewerMouseButtons MouseButtom){

MedicalViewerActionType type;

try
{
type = MedicalViewerActionType.Alpha;
if (MouseButtom == cell.GetActionButton(type))
{
return type;
}

type = MedicalViewerActionType.AnnotationAngle;
if (MouseButtom == cell.GetActionButton(type))
{
return type;
}

type = MedicalViewerActionType.AnnotationArrow;
if (MouseButtom == cell.GetActionButton(type))
{
return type;
}

type = MedicalViewerActionType.AnnotationAudio;
if (MouseButtom == cell.GetActionButton(type))
{
return type;
}

type = MedicalViewerActionType.AnnotationButton;
if (MouseButtom == cell.GetActionButton(type))
{
return type;
}

....... all action type of code ......

return MedicalViewerActionType.None;
}
catch(Exception ex)
{
OutputErrorWithMethodName("GetMouseActionType例外発生", ex);
return MedicalViewerActionType.None;
}
}

-----------------------------------------------------------------------------------------------------------------
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, February 6, 2012 1:11:10 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Before calling the cell.GetActionButton() method, you have to make sure that the specified action is already added to the container. You can do this using the cell.IsActionAdded() method. The code will be something as follows:
+--------------+
MedicalViewerActionType type = new MedicalViewerActionType();
MedicalViewerMultiCell cell = _medicalViewer.Cells[0] as MedicalViewerMultiCell;
MedicalViewerMouseButtons MouseButtom = MedicalViewerMouseButtons.Left;
bool Added = true;

try
{

type = MedicalViewerActionType.Alpha;
Added = cell.IsActionAdded(type);
if (Added)
{
if (MouseButtom == cell.GetActionButton(type))
{
MessageBox.Show(type.ToString() + " , " + MouseButtom.ToString());
}
}

type = MedicalViewerActionType.AnnotationAngle;
Added = cell.IsActionAdded(type);
if (Added)
{
if (MouseButtom == cell.GetActionButton(type))
{
MessageBox.Show(type.ToString() + " , " + MouseButtom.ToString());
}
}

type = MedicalViewerActionType.AnnotationArrow;
Added = cell.IsActionAdded(type);
if (Added)
{
if (MouseButtom == cell.GetActionButton(type))
{
MessageBox.Show(type.ToString() + " , " + MouseButtom.ToString());
}
}

type = MedicalViewerActionType.AnnotationAudio;
Added = cell.IsActionAdded(type);
if (Added)
{
if (MouseButtom == cell.GetActionButton(type))
{
MessageBox.Show(type.ToString() + " , " + MouseButtom.ToString());
}
}

type = MedicalViewerActionType.AnnotationButton;
Added = cell.IsActionAdded(type);
if (Added)
{
if (MouseButtom == cell.GetActionButton(type))
{
MessageBox.Show(type.ToString() + " , " + MouseButtom.ToString());
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
+--------------+

If the problem persists, please tell me what is the error that you get?
And what is the function the shows the error?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.121 seconds.