Beispiel #1
0
 private void _DrowLine2(FaceModelRect faceRect, Color color, int thickness, Size size)
 {
     using (Graphics graphics = base.CreateGraphics())
     {
         Point[][] arg_1D_0 = FaceDrawLines.GetPoints(faceRect, 6, size, base.Size);
         graphics.SmoothingMode = SmoothingMode.AntiAlias;
         Point[][] array = arg_1D_0;
         for (int i = 0; i < array.Length; i++)
         {
             Point[] points = array[i];
             graphics.DrawLines(new Pen(color, (float)thickness), points);
         }
         graphics.Save();
     }
 }
Beispiel #2
0
        private void _DrowLine(FaceModelRect faceRect, Color color, int thickness)
        {
            decimal d  = base.Height / this.CaptureSize.Height;
            decimal d2 = base.Width / this.CaptureSize.Width;

            faceRect.Top    = Convert.ToInt32(Math.Ceiling(faceRect.Top * d));
            faceRect.Bottom = Convert.ToInt32(Math.Ceiling(faceRect.Bottom * d));
            faceRect.Left   = Convert.ToInt32(Math.Ceiling(faceRect.Left * d2));
            faceRect.Right  = Convert.ToInt32(Math.Ceiling(faceRect.Right * d2));
            Rectangle rect    = FaceHelper.MC_GetRectangleByRect(faceRect);
            Graphics  expr_D9 = base.CreateGraphics();

            expr_D9.SmoothingMode = SmoothingMode.AntiAlias;
            expr_D9.DrawRectangle(new Pen(color, (float)thickness), rect);
            expr_D9.Dispose();
        }
 public static Point[][] GetPoints(FaceModelRect _faceRect, int cutCount, Size size)
 {
     Point[][] result;
     try
     {
         FaceModelRect faceModelRect = new FaceModelRect
         {
             Top    = _faceRect.Top,
             Bottom = _faceRect.Bottom,
             Left   = _faceRect.Left,
             Right  = _faceRect.Right
         };
         int num  = (faceModelRect.Right - faceModelRect.Left) / cutCount;
         int num2 = (faceModelRect.Bottom - faceModelRect.Top) / cutCount;
         num = num2;
         Point[] array = new Point[]
         {
             new Point(faceModelRect.Left, faceModelRect.Top),
             new Point(faceModelRect.Left, faceModelRect.Top + num2)
         };
         Point[] array2 = new Point[]
         {
             new Point(faceModelRect.Left, faceModelRect.Bottom - num2),
             new Point(faceModelRect.Left, faceModelRect.Bottom)
         };
         Point[] array3 = new Point[]
         {
             new Point(faceModelRect.Left, faceModelRect.Bottom),
             new Point(faceModelRect.Left + num, faceModelRect.Bottom)
         };
         Point[] array4 = new Point[]
         {
             new Point(faceModelRect.Right - num, faceModelRect.Bottom),
             new Point(faceModelRect.Right, faceModelRect.Bottom)
         };
         Point[] array5 = new Point[]
         {
             new Point(faceModelRect.Right, faceModelRect.Bottom),
             new Point(faceModelRect.Right, faceModelRect.Bottom - num2)
         };
         Point[] array6 = new Point[]
         {
             new Point(faceModelRect.Right, faceModelRect.Top + num2),
             new Point(faceModelRect.Right, faceModelRect.Top)
         };
         Point[] array7 = new Point[]
         {
             new Point(faceModelRect.Right, faceModelRect.Top),
             new Point(faceModelRect.Right - num, faceModelRect.Top)
         };
         Point[] array8 = new Point[]
         {
             new Point(faceModelRect.Left + num, faceModelRect.Top),
             new Point(faceModelRect.Left, faceModelRect.Top)
         };
         result = new Point[][]
         {
             array,
             array2,
             array3,
             array4,
             array5,
             array6,
             array7,
             array8
         };
     }
     catch (Exception arg_258_0)
     {
         throw arg_258_0;
     }
     return(result);
 }
 public static Point[][] GetPoints(FaceModelRect _faceRect, int cutCount, Size size, Size zoomSize)
 {
     Point[][] result;
     try
     {
         FaceModelRect faceModelRect = new FaceModelRect
         {
             Top    = _faceRect.Top,
             Bottom = _faceRect.Bottom,
             Left   = _faceRect.Left,
             Right  = _faceRect.Right
         };
         decimal d  = zoomSize.Height / size.Height;
         decimal d2 = zoomSize.Width / size.Width;
         faceModelRect.Top    = Convert.ToInt32(Math.Ceiling(faceModelRect.Top * d));
         faceModelRect.Bottom = Convert.ToInt32(Math.Ceiling(faceModelRect.Bottom * d));
         faceModelRect.Left   = Convert.ToInt32(Math.Ceiling(faceModelRect.Left * d2));
         faceModelRect.Right  = Convert.ToInt32(Math.Ceiling(faceModelRect.Right * d2));
         int num  = (faceModelRect.Right - faceModelRect.Left) / cutCount;
         int num2 = (faceModelRect.Bottom - faceModelRect.Top) / cutCount;
         num = num2;
         Point[] array = new Point[]
         {
             new Point(faceModelRect.Left, faceModelRect.Top),
             new Point(faceModelRect.Left, faceModelRect.Top + num2)
         };
         Point[] array2 = new Point[]
         {
             new Point(faceModelRect.Left, faceModelRect.Bottom - num2),
             new Point(faceModelRect.Left, faceModelRect.Bottom)
         };
         Point[] array3 = new Point[]
         {
             new Point(faceModelRect.Left, faceModelRect.Bottom),
             new Point(faceModelRect.Left + num, faceModelRect.Bottom)
         };
         Point[] array4 = new Point[]
         {
             new Point(faceModelRect.Right - num, faceModelRect.Bottom),
             new Point(faceModelRect.Right, faceModelRect.Bottom)
         };
         Point[] array5 = new Point[]
         {
             new Point(faceModelRect.Right, faceModelRect.Bottom),
             new Point(faceModelRect.Right, faceModelRect.Bottom - num2)
         };
         Point[] array6 = new Point[]
         {
             new Point(faceModelRect.Right, faceModelRect.Top + num2),
             new Point(faceModelRect.Right, faceModelRect.Top)
         };
         Point[] array7 = new Point[]
         {
             new Point(faceModelRect.Right, faceModelRect.Top),
             new Point(faceModelRect.Right - num, faceModelRect.Top)
         };
         Point[] array8 = new Point[]
         {
             new Point(faceModelRect.Left + num, faceModelRect.Top),
             new Point(faceModelRect.Left, faceModelRect.Top)
         };
         result = new Point[][]
         {
             array,
             array2,
             array3,
             array4,
             array5,
             array6,
             array7,
             array8
         };
     }
     catch (Exception arg_320_0)
     {
         throw arg_320_0;
     }
     return(result);
 }