Click here to Skip to main content
16,012,223 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have to scale the mouse position as we use from our laptops, (from a small pad to a full screen). I want to know the formula or a simple simulation program in which we move on smaller scale but effect on larger scale.

I think you understand what I want to ask.

Hope for kind reply.

Thanks
Posted
Updated 23-Aug-10 22:29pm
v2
Comments
Dalek Dave 24-Aug-10 4:29am    
Edited for Grammar.

Your mouse does not work that way, so it's impossible. Your finger moving over the mouse pad sends a message that contains tracking information, in terms of if you moved left or right, it does not contain an absolute position.
 
Share this answer
 
Transformation formula for two rectangular area is really simple (assuming the same orientation of axes):
x = w/W * X;
y = h/H * Y;


where
  • {W,H} are dimensions (width and height) of the source area (e.g. the smaller one).
  • {w,h} are the dimensions of the target area (e.g. the bigger one).
  • {X,Y} are the coordinates of a point in the source area space.
  • {x,y} are the coordinates of the same point in the target area space.


However, as Christian stated, this info is possibly pretty useless in your case.
:-)
 
Share this answer
 
its quit easy in 2.0


tis code ll work on ur form window.....


* select mouse move event or ur windows form
* drag and drop two label control to display ur mouse position
* write tis code in mouse move event

\\ tis code for x- coordinate
label1.text=mouseposition.x.tostring();
\\ tis code for x- coordinate
label2.text=mouseposition.y.tostring();


or else we can put together in single label itself


label1.Text=String.Format("x={0} y={1} wheel={2}", e.X, e.Y, e.Delta);





i hope i ll be helpful for u
 
Share this answer
 
Comments
Christian Graus 24-Aug-10 4:04am    
Reason for my vote of 1
Apart from the annoying txt speak, this is utterly worthless and does nothing to answer the users question.
Toli Cuturicu 24-Aug-10 6:43am    
Reason for my vote of 1
really bad

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900