Mouse meter C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SLEMPIE
    New Member
    • Apr 2008
    • 2

    Mouse meter C#

    Hey,

    for an application i need an option that makes it possible to measure the distance with your mouse in meters.
    For example i have a rectangle that is 80 meters X 60 meters with 4 circles in it and if i move my mouse around these cirkels i need to know what the distance between the cirkels is in meters.
    Is this possible in WPF or Winforms??

    best regards
    SLEMPIE
  • azoapes
    New Member
    • Apr 2008
    • 7

    #2
    The main problem would be that a pixel is not the same size on two different monitors. And if you add CRT, LCD and TV to the monitor types... naw, don't think it's possible.

    Comment

    • SLEMPIE
      New Member
      • Apr 2008
      • 2

      #3
      That is true not every screen is the same but the scale stays the same.
      If you draw a rectangle 80m X 60m and you tak 1px = 0,1m then the rectangle
      is 800px * 600px on every screen.
      So its possible to move in straight lines, you take the coordinates of te beginning and ending of the line and if you moved 40 px then you did 4m but the difficulty is when you move in a curve ore a polygon how doe je measure that...

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        You need to know some math for this. Or at least a math trick.

        For normal problems, you would need to compute arc-lenth (modified forumla for circumfrence of a circle)

        However, you don't have a true arc I would image. I would think you have a series of points that when plotted give the appearance of an arc.
        Simple do the distance formula for between each point and add them together to get a length.
        The more points you have, the better approximation of the arc length you can produce.

        Comment

        Working...