/// <summary> /// Transforms rectangle from data coordinates to viewport coordinates. /// </summary> /// <param name="dataRect">Rectangle in data coordinates</param> /// <param name="transform">CoordinateTransform used to perform transformation</param> /// <returns>Rectangle in viewport coordinates</returns> public static Rect DataToViewport(this Rect dataRect, DataTransform transform) { Point p1 = transform.DataToViewport(dataRect.BottomLeft); Point p2 = transform.DataToViewport(dataRect.TopRight); return(new Rect(p1, p2)); }
/// <summary> /// Transforms point in data coordinates to viewport coordinates. /// </summary> /// <param name="dataPoint">Point in data coordinates</param> /// <param name="transform">CoordinateTransform used to perform transformation</param> /// <returns>Point in viewport coordinates</returns> public static Point DataToViewport(this Point dataPoint, DataTransform transform) { return(transform.DataToViewport(dataPoint)); }