Beispiel #1
0
        //----------------------------------------------------------------------
        // ■アプリ系処理
        //----------------------------------------------------------------------
        /// <summary>
        /// 戦闘をループします.
        /// </summary>
        private void buttleLoop(PictureBox view)
        {
            List <ClickPointDto> dtoList = new List <ClickPointDto>();

            dtoList.Add(mapSelectPage);
            dtoList.Add(shutugeki);
            dtoList.Add(kantaiSentaku);
            if (bossYusenFlg)
            {
                dtoList.Add(enemyBoss);
            }
            dtoList.Add(enemy3_1);
            dtoList.Add(enemy2_1);
            dtoList.Add(enemy1_1);
            if (!bossYusenFlg)
            {
                dtoList.Add(enemyBoss);
            }
            dtoList.Add(kaihi);
            dtoList.Add(buttleStart);
            dtoList.Add(judgeWinS);
            dtoList.Add(judgeWinA);
            dtoList.Add(getItem);
            dtoList.Add(drop);
            dtoList.Add(kakunin);
            dtoList.Add(kinkyuNinmu);

            Bitmap bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
                                    Screen.PrimaryScreen.Bounds.Height);

            while (!breakFlg)
            {
                // 前回のbitmapをクリア
                bmp.Dispose();

                Thread.Sleep(500);

                // Bitmapの作成
                bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
                                 Screen.PrimaryScreen.Bounds.Height);

                // Graphicsを利用して、bmpに画面キャプチャをコピー
                graphicsService.CopyScreen(bmp);

                // 表示
                //view.Image = bmp;

                // メッセージポンプ(フリーズ回避)
                System.Windows.Forms.Application.DoEvents();

                // メイン処理
                analysis(bmp, dtoList);

                GC.Collect();
            }
        }