示例#1
0
 /// <summary>
 /// Creates a tranformation matrix that transforms coordinates from inside the given rectangle to a viewport of given size. The bottom-left of the rectangle is assumed to be the origin.
 /// </summary>
 /// <param name="rectangle"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 /// <returns></returns>
 public static Matrix2D FromRectangle(RectangleF2D rectangle, double width, double height)
 {
     return(Matrix2D.FromRectangle(rectangle, width, height, false, false));
 }
示例#2
0
 /// <summary>
 /// Creates a transformation matrix that transforms coordinates from the scene to the given viewport.
 /// </summary>
 /// <param name="pixelsWidth"></param>
 /// <param name="pixelsHeight"></param>
 /// <returns></returns>
 public Matrix2D CreateToViewPort(double pixelsWidth, double pixelsHeight)
 {
     // to viewport means from rectangle.
     return(Matrix2D.FromRectangle(_rectangle, pixelsWidth, pixelsHeight, _invertX, _invertY));
 }
示例#3
0
 /// <summary>
 /// Creates a transformation matrix for a scaling operation.
 /// </summary>
 /// <param name="factor"></param>
 /// <returns></returns>
 public static Matrix2D Scale(double factor)
 {
     return(Matrix2D.Scale(factor, factor));
 }
示例#4
0
 /// <summary>
 /// Creates a transformation matrix that transforms coordinates from the view port to scene-coordinates.
 /// </summary>
 /// <param name="pixelsWidth"></param>
 /// <param name="pixelsHeight"></param>
 /// <returns></returns>
 public Matrix2D CreateFromViewPort(double pixelsWidth, double pixelsHeight)
 {
     // from viewport means to rectangle.
     return(Matrix2D.ToRectangle(_rectangle, pixelsWidth, pixelsHeight, _invertX, _invertY));
 }