Exemple #1
0
        private void VideoCutterTimeline_MouseClick(object sender, MouseEventArgs e)
        {
            var clientLocation = e.Location;
            var pos            = (Length == 0 ? (long)0 : (long)(clientLocation.X / (float)ClientRectangle.Width * (float)Length));

            if (e.Button == MouseButtons.Left)
            {
                TimelineClicked?.Invoke(this, new TimelineClickedEventArgs()
                {
                    ClickedPosition = pos,
                });
            }
            if (e.Button == MouseButtons.Right)
            {
                if (SelectionStart != null && SelectionEnd != null)
                {
                    SelectionStart = null;
                    SelectionEnd   = null;
                }

                if (SelectionStart == null)
                {
                    SelectionStart = pos;
                }
                else
                {
                    SelectionEnd = pos;
                }

                Invalidate();
            }
        }
Exemple #2
0
        private void VideoCutterTimeline_MouseMove(object sender, MouseEventArgs e)
        {
            HoverPosition = (Length == 0 ? (long)0 : (long)(e.Location.X / (float)ClientRectangle.Width * (float)Length));

            if (MouseButtons == MouseButtons.Left)
            {
                var clientLocation = e.Location;
                var pos            = (Length == 0 ? (long)0 : (long)(clientLocation.X / (float)ClientRectangle.Width * (float)Length));

                TimelineClicked?.Invoke(this, new TimelineClickedEventArgs()
                {
                    ClickedPosition = pos,
                });
            }
        }