Exemplo n.º 1
0
 private void Initialize()
 {
     this.cardNameLookup = new ImageParser.GlyphLookup(
         "Data\\draft_card_font.png",
         "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'-,Æ".Select(c => c.ToString()).ToList(),
         4);
     this.cardNameRectangles = new List <Rectangle>()
     {
         new Rectangle(163, 512, 75, 10),
         new Rectangle(269, 512, 75, 10),
         new Rectangle(375, 512, 75, 10),
         new Rectangle(479, 512, 75, 10),
         new Rectangle(585, 512, 75, 10),
         new Rectangle(691, 512, 75, 10),
         new Rectangle(797, 512, 75, 10),
         new Rectangle(902, 512, 75, 10),
         new Rectangle(163, 635, 75, 10),
         new Rectangle(269, 635, 75, 10),
         new Rectangle(375, 635, 75, 10),
         new Rectangle(479, 635, 75, 10),
         new Rectangle(585, 635, 75, 10),
         new Rectangle(691, 635, 75, 10),
         new Rectangle(797, 635, 75, 10)
     };
     this.cardImageLoading    = FastAccessImage.FromPath("Data\\draft_card_image_loading.png");
     this.cardImageRectangles = this.cardNameRectangles.ConvertAll(
         r => new Rectangle(r.X, r.Y + 11, this.cardImageLoading.Width, this.cardImageLoading.Height));
     this.countLookup = new ImageParser.GlyphLookup(
         "Data\\draft_count_font.png",
         "0123456789".Select(c => c.ToString()).ToList(),
         4);
     this.countRectangle       = new Rectangle(21, 728, 26, 9);
     this.timeRemainingLookups = new List <ImageParser.GlyphLookup>()
     {
         new ImageParser.GlyphLookup(
             "Data\\draft_clock_font.png",
             "0123456789:-".Select(c => c.ToString()).ToList(),
             4),
         new ImageParser.GlyphLookup(
             "Data\\draft_clock_yellow_font.png",
             "0123456789:-".Select(c => c.ToString()).ToList(),
             4),
         new ImageParser.GlyphLookup(
             "Data\\draft_clock_red_font.png",
             "0123456789:-".Select(c => c.ToString()).ToList(),
             4)
     };
     this.timeRemainingRectangle  = new Rectangle(59, 492, 36, 8);
     this.pickAccepted            = FastAccessImage.FromPath("Data\\pick_accepted.png");
     this.pickAcceptedRectangle   = new Rectangle(190, 512, this.pickAccepted.Width, this.pickAccepted.Height);
     this.submittingPick          = FastAccessImage.FromPath("Data\\submitting_pick.png");
     this.submittingPickRectangle = new Rectangle(190, 512, this.submittingPick.Width, this.submittingPick.Height);
 }
Exemplo n.º 2
0
        public static void ReadDirectory()
        {
            DraftParser parser = new DraftParser();

            foreach (string file in Directory.GetFiles(DraftImageDirectory))
            {
                if (DraftImageExtensions.Contains(new FileInfo(file).Extension))
                {
                    DraftParser.Result result = parser.Read(FastAccessImage.FromPath(file));
                    Console.WriteLine(file + " = " + result);
                }
            }
        }
Exemplo n.º 3
0
        public static void Main(string[] args)
        {
            string draftImageDirectory = @"P:\Code\svn\Projects\magic\cs\Magic.App\bin\Debug\Screenshot\1";

            string[] draftImageExtensions = new string[] { ".png", ".bmp" };

            DraftParser parser = new DraftParser();

            foreach (string file in Directory.GetFiles(draftImageDirectory))
            {
                if (draftImageExtensions.Contains(new FileInfo(file).Extension))
                {
                    DraftParser.Result result = parser.Read(FastAccessImage.FromPath(file));
                    Console.WriteLine(file + " = " + result);
                }
            }
        }