示例#1
0
 public MatchForm()
 {
     MTemplate = new MatchTemplate();
     InitializeComponent();
     SetStyle(ControlStyles.AllPaintingInWmPaint, true);
     SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
     SetStyle(ControlStyles.UserPaint, true);
     SetStyle(ControlStyles.ResizeRedraw, true);
     this.MouseWheel += new MouseEventHandler(MatchForm_MouseWheel);
 }
示例#2
0
        static void Main(string[] args)
        {
            templateMatch = new MatchTemplate();

            var cardList   = Cards(@"D:\_ZC\JDownload\misc\YuGi");//D:\Entertetment\YuGiOh\YuGi
            var monsterDir = @"D:\_ZC\JDownload\misc\YuGi\Monsters";

            for (int i = 0; i < cardList.Length; i++)
            {
                Image img  = Image.FromFile(cardList[i].FullName);
                var   text = ocr(img);
                var   ret  = MonsterCards(img);
                Console.WriteLine(i);
                if (!string.IsNullOrEmpty(ret))
                {
                    switch (ret)
                    {
                    case "WATER":
                        cardList[i].CopyTo($"{monsterDir}\\{ret}\\{cardList[i].Name}");
                        break;

                    case "DARK":
                        cardList[i].CopyTo($"{monsterDir}\\{ret}\\{cardList[i].Name}");
                        break;

                    case "FIRE":
                        cardList[i].CopyTo($"{monsterDir}\\{ret}\\{cardList[i].Name}");
                        break;

                    case "LIGHT":
                        cardList[i].CopyTo($"{monsterDir}\\{ret}\\{cardList[i].Name}");
                        break;

                    case "WIND":
                        cardList[i].CopyTo($"{monsterDir}\\{ret}\\{cardList[i].Name}");
                        break;

                    case "EARTH":
                        cardList[i].CopyTo($"{monsterDir}\\{ret}\\{cardList[i].Name}");
                        break;
                    }
                }
            }
        }