示例#1
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="config">設定情報</param>
        public ConfigurationForm(PuyofuConfiguration config)
        {
            this.config = config;

            InitializeComponent();
            Init();
        }
示例#2
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public MainForm()
        {
            InitializeComponent();

            playerNameTxts = new TextBox[] { playerNameTxt1, playerNameTxt2 };
            tagsTxts       = new TextBox[] { tagsTxt1, tagsTxt2 };
            stepRecordTxts = new TextBox[] { stepRecordTxt1, stepRecordTxt2 };

            statusLabel.Text = "";
            fpsLbl.Text      = "";

            // 設定情報を読み込み初期化
            config = new PuyofuConfiguration();
            config.Init();

            detector.SimilarityThreshold = config.SimilarityThreshold;
            similarityValueBar.Value     = config.SimilarityThreshold;
            similarityValueLbl.Text      = similarityValueBar.Value.ToString();
            recordIdTxt.Text             = config.RecordId.ToString();
            recordDate.Text     = config.RecordDate;
            playerNameTxt1.Text = config.PlayerName1;
            playerNameTxt2.Text = config.PlayerName2;
            CheckFieldRadio(config.TargetField);

            if (config.CaptureRect.Top > 0 &&
                config.CaptureRect.Left > 0 &&
                config.CaptureRect.Width > 0 &&
                config.CaptureRect.Height > 0)
            {
                captureRects = new CaptureRects();
                captureRects.CalculateRects(config.CaptureRect);
                BeginCapturing();
            }

            // サンプリング画像初期設定
            updateSamples();

            // ペンの初期化
            pens[PuyoType.AKA]      = new Pen(Color.Red, 2);
            pens[PuyoType.MIDORI]   = new Pen(Color.Green, 2);
            pens[PuyoType.AO]       = new Pen(Color.LightBlue, 2);
            pens[PuyoType.KI]       = new Pen(Color.Yellow, 2);
            pens[PuyoType.MURASAKI] = new Pen(Color.Purple, 2);
        }