private void OnTimedEventCurve(Object source, System.Timers.ElapsedEventArgs e)
        {
            //남은횟수 계산
            if ((--time) == 0)
            {
                t.Stop();
                isDoingAnim = false;
            }

            // 시작 점과 첫번째 점 사이를 이동할 때

            if (curveCnt < curveInterval)
            {
                //curvePoint = CatmullRomSpline(CrvPtr[0], CrvPtr[1], CrvPtr[2], CrvPtr[3], curveInterval, curveCnt + 1);
            }
            // 첫번째 점과 두번째 점 사이를 이동할 때
            else
            {
                //curvePoint = CatmullRomSpline(CrvPtr[1], CrvPtr[2], CrvPtr[3], CrvPtr[4], curveInterval, curveCnt - curveInterval + 1);
            }

            curvePoint = Bezier2(CrvPtr[1], CrvPtr[2], CrvPtr[3], 2 * curveInterval, ++curveCnt);
            //curvePoint = Bezier3(CrvPtr[1], CrvPtr[2], CrvPtr[3], curveInterval, ++curveCnt);

            startX = curvePoint[0];
            startY = curvePoint[1];

            //픽처박스 초기화
            background.Invalidate();
        }
Exemplo n.º 2
0
 private void pB_Earth_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     mDown      = true;
     l_Lat.Text = (90 - e.Y).ToString();
     l_Lon.Text = (e.X - 180).ToString();
     pB_Earth.Invalidate();
 }
Exemplo n.º 3
0
 private void lB_Result_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     if (prog == 100)
     {
         timer1.Stop();
         DateTime tempTime = new DateTime();
         tempTime = (DateTime)dateList[lB_Result.SelectedIndex];
         location.MainDateTime = tempTime;
         this.solarSystemData.PlanetPositions();
         pB_Space.Invalidate();
         b_Watch.Visible = true;
     }
 }
Exemplo n.º 4
0
        private static System.Windows.Forms.PictureBox GetDrawingBox()
        {
            var box = new System.Windows.Forms.PictureBox();
            var pen = new System.Drawing.Pen(System.Drawing.Color.White, System.Windows.Forms.Control.DefaultFont.Height * 2.2f);

            pen.StartCap = pen.EndCap = System.Drawing.Drawing2D.LineCap.Round;
            System.Drawing.Graphics graphics = null;
            box.SizeChanged += delegate
            {
                if (box.Width == 0 || box.Height == 0)
                {
                    return;
                }
                var oldImage = box.Image;
                box.Image = new System.Drawing.Bitmap(box.Width, box.Height);
                oldImage?.Dispose();
                graphics = System.Drawing.Graphics.FromImage(box.Image);
                graphics.FillRectangle(System.Drawing.Brushes.Black, 0, 0, box.Height, box.Height);
            };

            var lastPos = System.Drawing.Point.Empty;

            box.MouseMove += (sender, args) =>
            {
                if (args.Button == System.Windows.Forms.MouseButtons.Left)
                {
                    graphics.DrawLine(pen, lastPos, args.Location);
                    box.Invalidate();
                }
                lastPos = args.Location;
            };

            return(box);
        }
Exemplo n.º 5
0
 /// <summary>
 /// 停止播放
 /// </summary>
 /// <param name="RealPlayWnd"></param>
 /// <param name="index"></param>
 public void StopPreview(System.Windows.Forms.PictureBox RealPlayWnd, int index)
 {
     //停止预览 Stop live view
     if (m_lRealHandle[index] != -1)
     {
         if (!CHCNetSDK.NET_DVR_StopRealPlay(m_lRealHandle[index]))
         {
             iLastErr = CHCNetSDK.NET_DVR_GetLastError();
             str      = "NET_DVR_StopRealPlay failed, error code= " + iLastErr;
             throw new VideoPlayerException(str);
         }
     }
     m_lRealHandle[index] = -1;
     RealPlayWnd.Invalidate();//刷新窗体
 }
Exemplo n.º 6
0
 public void Update()
 {
     pictureBox.Invalidate();
 }
Exemplo n.º 7
0
 private void nUD_ValueChanged(object sender, System.EventArgs e)
 {
     pB_Graf.Invalidate();
 }