<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>Dear all.</DIV>
<DIV>I tried that capture the position of mouse during move the mouse left button in MFC application.</DIV>
<DIV>But I cannot get values the position of mouse ,because in vtkCommand,there is only <FONT size=2>
<P>vtkCommand::MouseMoveEvent.</P>
<P>This event correspound to all mouse move events, namely LButton,MButton and RButon,etc.</P>
<P>How can I get the position during move the mouse left button.</P>
<P>In my vc++ program code, part of mouse event as follow.</P>
<P> </P><FONT size=2>
<P>RMouseCommand=vtkCallbackCommand::New();</P>
<P>RMouseCommand->SetClientData(</FONT><FONT color=#0000ff size=2>this</FONT><FONT size=2>);</P>
<P>RMouseCommand->SetCallback(RButtonPressMouseEvents);</P>
<P>istyle->AddObserver(vtkCommand::MouseMoveEvent,RMouseCommand);</P>
<P> </P><FONT color=#0000ff size=2>
<P>void</FONT><FONT size=2> CDicomViewerDlg::RButtonPressMouseEvents(vtkObject* caller, </FONT><FONT color=#0000ff size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>long</FONT><FONT size=2> event, </FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2>* clientdata, </FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2>* callData)</P>
<P>{</P>
<P>CDicomViewerDlg* self = </FONT><FONT color=#0000ff size=2>reinterpret_cast</FONT><FONT size=2>< CDicomViewerDlg*>( clientdata );</P>
<P></FONT>
<P><FONT color=#008000 size=2></P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> x,y; </P>
<P></FONT><FONT color=#0000ff size=2>switch</FONT><FONT size=2>(event)</P>
<P>{</P>
<P></FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> vtkCommand::MouseMoveEvent:</P>
<P>vtkInteractorStyle * istyle = vtkInteractorStyle::SafeDownCast(caller);</P>
<P>vtkRenderWindowInteractor * iren = istyle->GetInteractor();</P>
<P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> * pos = iren->GetEventPosition(); </P>
<P>x=pos[0];y=pos[1];</P>
<P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2>(y >(self->FrameHeight/2))</P>
<P>{</P>
<P>self->scaleFactor1=self->scaleFactor1*1.05;</P>
<P>self->scaleFactor2=self->scaleFactor2*1.05;</P>
<P>self->ImageReslice->SetOutputSpacing(self->scaleFactor1,self->scaleFactor2,1.0);</P>
<P>self->renWin->Render();</P>
<P>} </FONT><FONT color=#0000ff size=2>else</FONT><FONT size=2> {</P>
<P>self->scaleFactor1=self->scaleFactor1/1.05;</P>
<P>self->scaleFactor2=self->scaleFactor2/1.05;</P>
<P>self->ImageReslice->SetOutputSpacing(self->scaleFactor1,self->scaleFactor2,1.0);</P>
<P>self->renWin->Render();</P>
<P>}</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P>}</P>
<P>}</P>
<P> </P>
<P>Above code part pass to all mouse move event.</P>
<P>I want to process only mouse's left button moveing event .</P>
<P>Who can tell me?</P>
<P>Thanks a lot!</P></FONT></FONT></FONT></DIV></div><br>
<hr size=1>
Don't get soaked. Take a<a href="
http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news"> quick peak at the forecast </a><br> with the<a href="
http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news">Yahoo! Search weather shortcut.</a></body></html>