Profile Picture

Transform Chart Point to Mouse Position?

Posted By 2 Years Ago
Author
Message
Posted 2 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 0, Visits: 78
Given a mouse position on a Cartesian chart, I can transform the point into a chart point using the following code:


  protected NPointD TransformMousePositionToChartPoint(NMouseEventArgs e)
   {
    var view2Scale = new NViewToScale2DTransformation(this.cartesianChart, (int)StandardAxis.PrimaryX, (int)StandardAxis.PrimaryY);
    var scalePoint = new NVector2DD();
    view2Scale.Transform(new NPointF(e.X, e.Y), ref scalePoint);
    var transformedPoint = new NPointD();
    transformedPoint.X = scalePoint.X;
    transformedPoint.Y = scalePoint.Y;
    return transformedPoint;
   }


Can I do the reverse? Given a point on the chart, can I transform it into a mouse position? If so, how?




Similar Topics


Reading This Topic