Пример #1
0
        private void TourCup8_Paint(object sender, PaintEventArgs e)
        {
            if (show)
            {
                Font font = new Font("宋体", 11 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

                for (int i = 0; i < 8; i++)
                {
                    Image head = MatchManager.GetHeadImage(tourData.Pids[i]);
                    if (head != null)
                    {
                        e.Graphics.DrawImage(head, 10, 50 * i + 10, 36, 36);
                    }
                    e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Pids[i]), font, IsPlayerLost(tourData.Pids[i]) ? Brushes.DimGray : Brushes.White, 50, 50 * i + 25);
                }
                for (int i = 0; i < 4; i++)
                {
                    MatchManager.DrawCrossing(e.Graphics, 100, 100 * i + 33, 140, 100 * i + 83);
                    if (tourData.Results[i].Winner != 0)
                    {
                        Image head = MatchManager.GetHeadImage(tourData.Results[i].Winner);
                        if (head != null)
                        {
                            e.Graphics.DrawImage(head, 148, 100 * i + 35, 36, 36);
                        }
                        e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Results[i].Winner), font, IsPlayerLost(tourData.Results[i].Winner) ? Brushes.DimGray : Brushes.White, 188, 100 * i + 50);
                    }
                }
                for (int i = 0; i < 2; i++)
                {
                    MatchManager.DrawCrossing(e.Graphics, 238, 200 * i + 58, 278, 200 * i + 158);
                    if (tourData.Results[i + 4].Winner != 0)
                    {
                        Image head = MatchManager.GetHeadImage(tourData.Results[i + 4].Winner);
                        if (head != null)
                        {
                            e.Graphics.DrawImage(head, 286, 200 * i + 85, 36, 36);
                        }
                        e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Results[i + 4].Winner), font, IsPlayerLost(tourData.Results[i + 4].Winner) ? Brushes.DimGray : Brushes.White, 326, 200 * i + 100);
                    }
                }
                MatchManager.DrawCrossing(e.Graphics, 376, 108, 416, 308);
                if (tourData.Results[6].Winner != 0)
                {
                    Image head = MatchManager.GetHeadImage(tourData.Results[6].Winner);
                    if (head != null)
                    {
                        e.Graphics.DrawImage(head, 424, 185, 36, 36);
                    }
                    e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Results[6].Winner), font, Brushes.White, 464, 200);
                }
            }
        }
Пример #2
0
        private void TourCup16_Paint(object sender, PaintEventArgs e)
        {
            if (show)
            {
                Font font = new Font("宋体", 11 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

                for (int i = 0; i < 16; i++)
                {
                    Image head = MatchManager.GetHeadImage(tourData.Pids[i]);
                    if (head != null)
                    {
                        e.Graphics.DrawImage(head, 10, 36 * i + 10, 24, 24);
                    }
                    e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Pids[i]), font, IsPlayerLost(tourData.Pids[i]) ? Brushes.DimGray : Brushes.White, 36, 36 * i + 15);
                }
                for (int i = 0; i < 8; i++)
                {
                    MatchManager.DrawCrossing(e.Graphics, 90, 72 * i + 21, 126, 72 * i + 57);
                    if (tourData.Results[i].Winner != 0)
                    {
                        Image head = MatchManager.GetHeadImage(tourData.Results[i].Winner);
                        if (head != null)
                        {
                            e.Graphics.DrawImage(head, 128, 72 * i + 25, 24, 24);
                        }
                        e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Results[i].Winner), font, IsPlayerLost(tourData.Results[i].Winner) ? Brushes.DimGray : Brushes.White, 154, 72 * i + 30);
                    }
                }
                for (int i = 0; i < 4; i++)
                {
                    MatchManager.DrawCrossing(e.Graphics, 208, 144 * i + 38, 244, 144 * i + 110);
                    if (tourData.Results[i + 8].Winner != 0)
                    {
                        Image head = MatchManager.GetHeadImage(tourData.Results[i + 8].Winner);
                        if (head != null)
                        {
                            e.Graphics.DrawImage(head, 246, 144 * i + 61, 24, 24);
                        }
                        e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Results[i + 8].Winner), font, IsPlayerLost(tourData.Results[i + 8].Winner) ? Brushes.DimGray : Brushes.White, 272, 144 * i + 66);
                    }
                }
                for (int i = 0; i < 2; i++)
                {
                    MatchManager.DrawCrossing(e.Graphics, 326, 288 * i + 74, 362, 288 * i + 219);
                    if (tourData.Results[i + 12].Winner != 0)
                    {
                        Image head = MatchManager.GetHeadImage(tourData.Results[i + 12].Winner);
                        if (head != null)
                        {
                            e.Graphics.DrawImage(head, 364, 288 * i + 134, 24, 24);
                        }
                        e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Results[i + 12].Winner), font, IsPlayerLost(tourData.Results[i + 12].Winner) ? Brushes.DimGray : Brushes.White, 390, 288 * i + 140);
                    }
                }
                MatchManager.DrawCrossing(e.Graphics, 444, 149, 480, 435);
                if (tourData.Results[14].Winner != 0)
                {
                    Image head = MatchManager.GetHeadImage(tourData.Results[14].Winner);
                    if (head != null)
                    {
                        e.Graphics.DrawImage(head, 482, 278, 24, 24);
                    }
                    e.Graphics.DrawString(MatchManager.GetPlayerName(tourData.Results[14].Winner), font, Brushes.White, 508, 284);
                }
            }
        }