/// <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 DataRect DataToViewport(this DataRect dataRect, DataTransform transform) { Point p1 = transform.DataToViewport(dataRect.XMinYMin); Point p2 = transform.DataToViewport(dataRect.XMaxYMax); return(new DataRect(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)); }