[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

Mapping client to screen coordinates

atk

11/17/2004 4:26:00 PM

Hello,

the application I am working on consists of a graphing UserControl and a
test Forms app. The user can plot points and connect them with lines on the
graphing surface of the control. The goal is to map those points'
coordinates to the X,Y coordinates of the mouse when it hovers over such a
point. The problem is mouse and points use different coord. systems. I
convert mouse X,Y to client X,Y with Control.PointToClient (thanks to Tim
Wilson!) but still can never map these to any client point coordinates.

How to achieve this? Please help!

TIA


2 Answers

Bob Powell

11/17/2004 4:41:00 PM

0

You should read my article in Windows Forms Tips and Tricks about
backtracking the mouse.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"atk" <atk_NO_SPAM@lalo_NO_SPAM.com> wrote in message
news:%23lK2TEMzEHA.4028@TK2MSFTNGP15.phx.gbl...
> Hello,
>
> the application I am working on consists of a graphing UserControl and a
> test Forms app. The user can plot points and connect them with lines on
the
> graphing surface of the control. The goal is to map those points'
> coordinates to the X,Y coordinates of the mouse when it hovers over such a
> point. The problem is mouse and points use different coord. systems. I
> convert mouse X,Y to client X,Y with Control.PointToClient (thanks to Tim
> Wilson!) but still can never map these to any client point coordinates.
>
> How to achieve this? Please help!
>
> TIA
>
>


atk

11/17/2004 7:29:00 PM

0

OK,

but I am not zooming anything, just want the mouse X0 and Y0 to be the same
as those of my control. What is the matrix I have to apply?

TIA


"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:e1xV0QMzEHA.748@TK2MSFTNGP14.phx.gbl...
> You should read my article in Windows Forms Tips and Tricks about
> backtracking the mouse.
>
> --
> Bob Powell [MVP]
> Visual C#, System.Drawing
>
> Find great Windows Forms articles in Windows Forms Tips and Tricks
> http://www.bobpowell.net/tips...
>
> Answer those GDI+ questions with the GDI+ FAQ
> http://www.bobpowell.net/f...
>
> All new articles provide code in C# and VB.NET.
> Subscribe to the RSS feeds provided and never miss a new article.
>
>
>
>
>
> "atk" <atk_NO_SPAM@lalo_NO_SPAM.com> wrote in message
> news:%23lK2TEMzEHA.4028@TK2MSFTNGP15.phx.gbl...
> > Hello,
> >
> > the application I am working on consists of a graphing UserControl and a
> > test Forms app. The user can plot points and connect them with lines on
> the
> > graphing surface of the control. The goal is to map those points'
> > coordinates to the X,Y coordinates of the mouse when it hovers over such
a
> > point. The problem is mouse and points use different coord. systems. I
> > convert mouse X,Y to client X,Y with Control.PointToClient (thanks to
Tim
> > Wilson!) but still can never map these to any client point coordinates.
> >
> > How to achieve this? Please help!
> >
> > TIA
> >
> >
>
>