Esempio n. 1
0
        /// <summary>
        /// メンバーのスクリーンショットを生成
        /// </summary>
        /// <param name="iFilePath">ファイルパス</param>
        /// <param name="iControl">追加コントロール</param>
        public void CreateMemberScreenShot(string iFilePath, UserControl iControl)
        {
            BeginScreenShot();

            //追加コントロールを結合する
            var grid         = SystemManager.GetInstance().GetScreenShotGrid();
            var stock_Margin = iControl.Margin;
            var current_Size = new Size(grid.Width, grid.Height);

            if (grid.Width < grid.Height)
            {
                //サイズ調整
                grid.Width += iControl.Width;
                if (grid.Height < iControl.Height)
                {
                    grid.Height = iControl.Height;
                }

                //結合
                var margin = new Thickness(current_Size.Width, 0, 0, 0);
                iControl.Margin = margin;
            }
            else
            {
                //サイズ調整
                grid.Height += iControl.Height;
                if (grid.Width < iControl.Width)
                {
                    grid.Width = iControl.Width;
                }

                //結合
                var margin = new Thickness(0, current_Size.Height, 0, 0);
                iControl.Margin = margin;
            }

            grid.Children.Add(iControl);
            SystemUtility.OutputCaptureControl(iFilePath, grid);
            grid.Children.Remove(iControl);
            grid.Children.Clear();
            iControl.Margin = stock_Margin;
        }
        //============================================================================
        //! トーナメント画像出力
        private void _ClickTournamentOutputItem(object iSender, RoutedEventArgs iArgs)
        {
            var stack_Group = ScaleGrid.LayoutTransform;
            var visible     = ContentScrollViewer.VerticalScrollBarVisibility;

            try
            {
                string file_Path = SystemUtility.GetRootPath() + @"ScreenShot\" + BattleManager.GetInstance().GetBattleOperator().GetBattleName() + "(トーナメント).png";
                foreach (var iControl in mTournamentGroupControlList)
                {
                    iControl.ClearSelectTeam();
                }

                var group = new TransformGroup();
                group.Children.Add(new ScaleTransform(1, 1));
                ScaleGrid.LayoutTransform = group;
                ContentScrollViewer.VerticalScrollBarVisibility   = ScrollBarVisibility.Hidden;
                ContentScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden;
                ContentGrid.UpdateLayout();

                SystemUtility.OutputCaptureControl(file_Path, ScaleGrid);

                ScaleGrid.LayoutTransform = stack_Group;
                ContentScrollViewer.VerticalScrollBarVisibility   = visible;
                ContentScrollViewer.HorizontalScrollBarVisibility = visible;
                ScaleGrid.UpdateLayout();
                System.Media.SystemSounds.Asterisk.Play();
                MessageBox.Show("以下にスクリーンショットを出力しました\n\n" + file_Path, "確認", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            catch (System.Exception)
            {
                ScaleGrid.LayoutTransform = stack_Group;
                ContentScrollViewer.VerticalScrollBarVisibility   = visible;
                ContentScrollViewer.HorizontalScrollBarVisibility = visible;
                ScaleGrid.UpdateLayout();
                System.Media.SystemSounds.Hand.Play();
                MessageBox.Show("スクリーンショットの出力に失敗しました", "エラー", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
        //============================================================================
        //! トーナメント画像出力
        private string _CreateTournamentScreenShot()
        {
            _ClearLeafFilter();

            string file_Path   = SystemUtility.GetRootPath() + @"ScreenShot\" + BattleOperatorManager.GetInstance().GetBattleName() + "(トーナメント).png";
            var    stock_Brush = Background;

            try
            {
                Background = new SolidColorBrush(Colors.Black);
                UpdateLayout();
                SystemUtility.OutputCaptureControl(file_Path, this);
                Background = stock_Brush;
            }
            catch (System.Exception iException)
            {
                Background = stock_Brush;
                System.Media.SystemSounds.Hand.Play();
                MessageBox.Show(string.Format("スクリーンショットの出力に失敗しました\n\n{0}", iException.Message), "エラー", MessageBoxButton.OK, MessageBoxImage.Error);
                file_Path = "";
            }

            return(file_Path);
        }
Esempio n. 4
0
 /// <summary>
 /// メンバーのスクリーンショットを生成
 /// </summary>
 /// <param name="iFilePath">ファイルパス</param>
 public void CreateMemberScreenShot(string iFilePath)
 {
     BeginScreenShot();
     SystemUtility.OutputCaptureControl(iFilePath, SystemManager.GetInstance().GetScreenShotGrid());
     SystemManager.GetInstance().GetScreenShotGrid().Children.Clear();
 }