示例#1
0
        public void OnMouseDown(object sender, MouseButtonEventArgs e)
        {
            Point  p           = e.GetPosition(VideoImage);
            double pixelWidth  = VideoImage.Source.Width;
            double pixelHeight = VideoImage.Source.Height;
            double x           = pixelWidth * p.X / VideoImage.ActualWidth;
            double y           = pixelHeight * p.Y / VideoImage.ActualHeight;

            OnMediaMouseDown?.Invoke(this, x, y);
        }
示例#2
0
        public void OnMouseDown(object sender, MouseButtonEventArgs e)
        {
            if (this.HasVideo)
            {
                Point  p           = e.GetPosition(this);
                double pixelWidth  = this.Width;
                double pixelHeight = this.Height;
                double x           = pixelWidth * p.X / this.ActualWidth;
                double y           = pixelHeight * p.Y / this.ActualHeight;

                OnMediaMouseDown?.Invoke(this, x, y);
            }
        }