예제 #1
0
        /// <summary>
        /// Crop Window - Button
        /// </summary>
        private void btnVideo_Crop_Click(object sender, RoutedEventArgs e)
        {
            // Start Window
            cropwindow = new CropWindow(this);

            // Detect which screen we're on
            var allScreens = System.Windows.Forms.Screen.AllScreens.ToList();
            var thisScreen = allScreens.SingleOrDefault(s => Left >= s.WorkingArea.Left && Left < s.WorkingArea.Right);

            // Position Relative to MainWindow
            // Keep from going off screen
            cropwindow.Left = Math.Max((Left + (Width - cropwindow.Width) / 2), thisScreen.WorkingArea.Left);
            cropwindow.Top  = Math.Max(Top - cropwindow.Height - 12, thisScreen.WorkingArea.Top);

            // Keep Window on Top
            cropwindow.Owner = Window.GetWindow(this);

            // Open Window
            cropwindow.ShowDialog();
        }
예제 #2
0
 /// <summary>
 /// Crop Clear Button
 /// </summary>
 private void btnVideo_CropClear_Click(object sender, RoutedEventArgs e)
 {
     // Clear Crop Values
     CropWindow.CropClear();
 }