Exemplo n.º 1
0
        private void TimeLine_MouseDown(object sender, MouseEventArgs e)
        {
            if (shots == null)
            {
                return;
            }
            PointF startPoint = new PointF(débutDessin, topTrack);

            shots.ForEach(s => { s.Selected = false; s.Current = false; });
            Refresh();
            List <Shots> sh = new List <Shots>();

            if (currentScene == null)
            {
                return;
            }
            currentScene.SequenceScene.ToList().ForEach(c => sh.Add(c.Shots));
            for (int i = 0; i < shotsWidth.Count; i++)
            {
                RectangleF rect = new RectangleF(startPoint, new SizeF(shotsWidth[i], trackHeight));
                if (rect.Contains(e.Location))
                {
                    Shots s = shots[i];
                    s.Selected = true;
                    Refresh();
                    ShotSelected?.Invoke(this, new ShotSelectedArgs {
                        Shot = s
                    });
                    break;
                }
                startPoint.X += shotsWidth[i];
            }
        }
Exemplo n.º 2
0
        private void frmMask_MouseUp(object sender, MouseEventArgs e)
        {
            if (isDrawing)
            {
                drawEnd   = Cursor.Position;
                localEnd  = e.Location;
                isDrawing = false;
                Refresh();
                shotRect = ShotArea(drawStart, drawEnd);

                // Take screenshot
                Bitmap   shot = new Bitmap(shotRect.Width, shotRect.Height, PixelFormat.Format32bppArgb);
                Graphics g    = Graphics.FromImage(shot);
                g.CopyFromScreen(shotRect.X, shotRect.Y, 0, 0, shot.Size, CopyPixelOperation.SourceCopy);

                ShotSelected?.Invoke(this, shot);
            }

            if (maybeDraw)
            {
                maybeDraw = false;
                isDrawing = false;
                Refresh();

                Screen screen = Screen.FromPoint(Cursor.Position);
                Color  pixel;
                int    x = Cursor.Position.X;
                int    y = Cursor.Position.Y;

                pixel = GetColorAt(x, y);
                ColorSelected?.Invoke(this, pixel);
            }
        }
Exemplo n.º 3
0
        private void Play_Click(object sender, EventArgs e)
        {
            List <Shots> sh = new List <Shots>();

            CurrentPosition = 0;
            CurrentTime     = 0;
            débutDessin     = 0;
            if (currentScene != null)
            {
                currentScene.SequenceScene.ToList().ForEach(c => sh.Add(c.Shots));
                ShotSelected?.Invoke(this, new ShotSelectedArgs {
                    Shots = sh
                });
            }
            else
            {
                ShotSelected?.Invoke(this, new ShotSelectedArgs {
                    Shots = shots
                });
            }
        }