Пример #1
0
        public IGeometric Draw(IPoint?Position = null)
        {
            var arry = Points.Select(x => x.ToAbs(Position ??= IPoint.Original)).
                       Polymerization((x, y) => CreateMathObj.GeometricLine(x, y)).ToArray();

            return(new BrokenLine(this, arry));
        }
Пример #2
0
        /// <summary>
        /// 获取真实设置的桌面分辨率大小
        /// </summary>
        private static ISizePixel DESKTOP()
        {
            IntPtr hdc  = GetDC(IntPtr.Zero);
            var    size = CreateMathObj.SizePixel(
                GetDeviceCaps(hdc, DESKTOPHORZRES),
                GetDeviceCaps(hdc, DESKTOPVERTRES));

            ReleaseDC(IntPtr.Zero, hdc);
            return(size);
        }
Пример #3
0
 /// <summary>
 /// 将一个二维坐标的X和Y取绝对值,并返回一个新的坐标
 /// </summary>
 /// <param name="point">待取绝对值的坐标</param>
 /// <returns></returns>
 public static IPoint Abs(this IPoint point)
 => CreateMathObj.Point(
     ToolArithmetic.Abs(point.Right),
     ToolArithmetic.Abs(point.Top));
Пример #4
0
 /// <summary>
 /// 获取形状的大小
 /// </summary>
 /// <param name="shape">待获取大小的形状</param>
 /// <returns></returns>
 public static ISize GetSize(this Shape shape)
 => CreateMathObj.Size(shape.Width, shape.Height);