コード例 #1
0
        private void MonsterSkillViewForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            Font font = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            e.Graphics.DrawString(" 全技能 ", font, Brushes.White, 320, 8);
            font.Dispose();

            cardDetail.Draw(e.Graphics);
            e.Graphics.FillRectangle(Brushes.DarkGray, 67, 37, cardWidth * xCount - 4, 44);
            Image img = PicLoader.Read("System", "SearchBack.JPG");

            e.Graphics.DrawImage(img, 70, 40, cardWidth * xCount - 10, 38);
            img.Dispose();

            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            e.Graphics.DrawString("分类", font, Brushes.White, 86, 51);
            font.Dispose();

            font = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            Font fontblack = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(245, 244, 242)), 65, cardHeight * yCount + 35 + cardHeight, cardWidth * xCount, 93);
            e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(190, 175, 160)), 65, cardHeight * yCount + 35 + cardHeight, cardWidth * xCount, 20);
            e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(190, 175, 160)), 65, cardHeight * yCount + 75 + cardHeight, cardWidth * xCount, 20);
            e.Graphics.DrawString("技能说明", fontblack, Brushes.White, 65, cardHeight * yCount + 37 + cardHeight);
            if (!string.IsNullOrEmpty(skillDesStr))
            {
                e.Graphics.DrawString(skillDesStr, font, Brushes.SaddleBrown, 65 + 5, cardHeight * yCount + 37 + cardHeight + 21);
            }
            e.Graphics.DrawString("所有生物", fontblack, Brushes.White, 65, cardHeight * yCount + 77 + cardHeight);
            fontblack.Dispose();
            font.Dispose();

            if (show)
            {
                int pages     = totalCount / cardCount + 1;
                int cardLimit = (page < pages - 1) ? cardCount : (totalCount % cardCount);
                int former    = cardCount * page + 1;
                if (isDirty)
                {
                    tempImage.Dispose();
                    tempImage = new Bitmap(cardWidth * xCount, cardHeight * yCount);
                    Graphics g = Graphics.FromImage(tempImage);
                    for (int i = former - 1; i < former + cardLimit - 1; i++)
                    {
                        var cardImg = SkillBook.GetSkillImage(skills[i]);
                        if (cardImg == null)
                        {
                            continue;
                        }
                        g.DrawImage(cardImg, (i % xCount) * cardWidth, ((i / xCount) % yCount) * cardHeight, cardWidth, cardHeight);
                    }
                    g.Dispose();
                    isDirty = false;
                }
                e.Graphics.DrawImage(tempImage, 65, 35 + cardHeight);

                if (sel != -1 && sel < totalCount)
                {
                    SolidBrush yellowbrush = new SolidBrush(Color.FromArgb(80, Color.Lime));
                    int        x           = (sel % xCount) * cardWidth + 65;
                    int        y           = ((sel / xCount) % yCount) * cardHeight + 35 + cardHeight;
                    e.Graphics.FillRectangle(yellowbrush, x, y, cardWidth, cardHeight);
                    yellowbrush.Dispose();

                    Pen yellowpen = new Pen(Brushes.Lime, 3);
                    e.Graphics.DrawRectangle(yellowpen, x, y, cardWidth, cardHeight);
                    yellowpen.Dispose();
                }
                if (tar != -1 && tar < totalCount)
                {
                    int        x           = (tar % xCount) * cardWidth + 65;
                    int        y           = ((tar / xCount) % yCount) * cardHeight + 35 + cardHeight;
                    SolidBrush yellowbrush = new SolidBrush(Color.FromArgb(80, Color.Yellow));
                    e.Graphics.FillRectangle(yellowbrush, x, y, cardWidth, cardHeight);
                    yellowbrush.Dispose();

                    Pen yellowpen = new Pen(Brushes.Yellow, 3);
                    e.Graphics.DrawRectangle(yellowpen, x, y, cardWidth, cardHeight);
                    yellowpen.Dispose();
                }
            }
        }
コード例 #2
0
        private void BattleResultForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            Font font = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            e.Graphics.DrawString("对战结果", font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();

            Image back = PicLoader.Read("System", "BattleResultBack.JPG");

            e.Graphics.DrawImage(back, 15, 35, 504, 354);
            back.Dispose();

            virtualRegion.Draw(e.Graphics);

            if (show)
            {
                font = new Font("微软雅黑", 15 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
                Font font2 = new Font("宋体", 12 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

                if (leftId == 0)
                {
                    Image head = PicLoader.Read("Player", string.Format("{0}.PNG", UserProfile.InfoBasic.Face));
                    e.Graphics.DrawImage(head, 95, 40, 50, 50);
                    head.Dispose();
                    e.Graphics.DrawString(UserProfile.ProfileName, font, Brushes.White, 155, 45);
                }
                else
                {
                    PeopleConfig leftPeople = ConfigData.GetPeopleConfig(leftId);
                    Image        head       = PicLoader.Read("People", string.Format("{0}.PNG", leftPeople.Figue));
                    e.Graphics.DrawImage(head, 95, 40, 50, 50);
                    head.Dispose();
                    e.Graphics.DrawString(leftPeople.Name, font, Brushes.White, 155, 45);
                }

                PeopleConfig rightPeople = ConfigData.GetPeopleConfig(rightId);
                Image        head2       = PicLoader.Read("People", string.Format("{0}.PNG", rightPeople.Figue));
                e.Graphics.DrawImage(head2, 305, 40, 50, 50);
                head2.Dispose();
                head2 = PicLoader.Read("System", "Win.PNG");
                e.Graphics.DrawImage(head2, isWin ? 135 : 345, 40, 109, 70);
                head2.Dispose();
                e.Graphics.DrawString(rightPeople.Name, font, Brushes.White, 370, 45);

                BattleStatisticData battleStatisticData = BattleManager.Instance.StatisticData;
                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Left.MonsterAdd), font2, Brushes.White, 159, 103);
                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Left.SpellAdd), font2, Brushes.White, 159, 123);
                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Left.Kill), font2, Brushes.White, 259, 103);
                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Left.WeaponAdd), font2, Brushes.White, 259, 123);
                e.Graphics.DrawString(GetDamageStr(battleStatisticData.Left.DamageTotal), font2, Brushes.White, 159, 143);

                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Right.MonsterAdd), font2, Brushes.White, 373, 103);
                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Right.SpellAdd), font2, Brushes.White, 373, 123);
                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Right.Kill), font2, Brushes.White, 473, 103);
                e.Graphics.DrawString(string.Format("{0,2:D}", battleStatisticData.Right.WeaponAdd), font2, Brushes.White, 473, 123);
                e.Graphics.DrawString(GetDamageStr(battleStatisticData.Right.DamageTotal), font2, Brushes.White, 373, 143);

                TimeSpan span = battleStatisticData.EndTime - battleStatisticData.StartTime;
                e.Graphics.DrawString(string.Format("{0:00}:{1:00}:{2:00}", span.Hours, span.Minutes, span.Seconds), font2, Brushes.White, 158, 195);
                e.Graphics.DrawString(string.Format("{0}", battleStatisticData.Round), font2, Brushes.White, 158, 175);

                font.Dispose();
                font2.Dispose();
            }
        }
コード例 #3
0
        private void NpcTalkForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            if (showImage)
            {
                Font font2 = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
                e.Graphics.DrawString(string.Format("{0}(Lv{1})({2})", config.Name, eventLevel, config.Script), font2, Brushes.White, Width / 2 - 40, 8);
                font2.Dispose();

                e.Graphics.DrawImage(SceneQuestBook.GetSceneQuestImageBig(config.Id), 20, 60, 300, 300);
                Image border = PicLoader.Read("Border", "scenequestbg.png"); //边框
                e.Graphics.DrawImage(border, 20, 60, 300, 300);
                border.Dispose();

                if (config.TriggerRate > 0 && config.TriggerRate <= 30)
                {//稀有
                    Image rareImg = PicLoader.Read("System", "sqrare2.png");
                    e.Graphics.DrawImage(rareImg, 20 + 16, 60 + 16, 64, 32);
                    rareImg.Dispose();
                }
                else if (config.TriggerRate > 0 && config.TriggerRate <= 60)
                {//罕见
                    Image rareImg = PicLoader.Read("System", "sqrare1.png");
                    e.Graphics.DrawImage(rareImg, 20 + 16, 60 + 16, 64, 32);
                    rareImg.Dispose();
                }

                if (evtItem != null)
                {
                    evtItem.Draw(e.Graphics);
                }

                colorWord.Draw(e.Graphics);
                if (vRegion != null)
                {
                    vRegion.Draw(e.Graphics);
                }

                if (answerList != null && (evtItem == null || evtItem.RunningState != TalkEventItem.TalkEventState.Running))
                {
                    int id       = 0;
                    var bgTarget = PicLoader.Read("System", "WordBack1.png");
                    var bgCommon = PicLoader.Read("System", "WordBack2.png");
                    foreach (var word in answerList)
                    {
                        var rect   = word.Rect;
                        var bgRect = new Rectangle(rect.X, rect.Y, rect.Width - 20, 24);
                        if (id == tar)
                        {
                            e.Graphics.DrawImage(bgTarget, bgRect);
                        }
                        else
                        {
                            e.Graphics.DrawImage(bgCommon, bgRect);
                        }

                        word.Draw(e.Graphics);
                        id++;
                    }
                    bgTarget.Dispose();
                    bgCommon.Dispose();
                }
            }
        }
コード例 #4
0
ファイル: ImageManager.cs プロジェクト: jayrulez/TOMClassic
 static ImageManager()
 {
     nullImage = PicLoader.Read("System", "Null.JPG");
 }
コード例 #5
0
ファイル: LiveMonster.cs プロジェクト: jayrulez/TOMClassic
        public void DrawOnBattle(Graphics g2, Color uponColor)
        {
            Bitmap   image = new Bitmap(100, 100);
            Graphics g     = Graphics.FromImage(image);

            if (!IsGhost)
            {
                var monImg = MonsterBook.GetMonsterImage(Avatar.Id, 100, 100);
                if (monImg != null)
                {
                    g.DrawImage(monImg, 0, 0, 100, 100);
                }

                if (uponColor != Color.White)
                {
                    SolidBrush brush = new SolidBrush(Color.FromArgb(150, uponColor));
                    g.FillRectangle(brush, 0, 0, 100, 100);
                    brush.Dispose();
                }
                var  pen       = new Pen(!IsLeft ? Brushes.Blue : Brushes.Red, 3);
                Font font2     = new Font("Arial", 14 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                Font fontLevel = new Font("Arial", 20 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
                g.DrawRectangle(pen, 1, 1, 98, 98);
                pen.Dispose();

                HpBar.Draw(g);

                g.FillPie(Brushes.Gray, 65, 65, 30, 30, 0, 360);
                var skillPercent = SkillManager.GetRoundSkillPercent();
                if (skillPercent > 0)
                {
                    //画集气槽
                    g.FillPie(Brushes.Purple, 65, 65, 30, 30, 0, skillPercent * 360 / 100);
                    //画行动槽
                    g.FillPie(CanAttack ? Brushes.Yellow : Brushes.LightGray, 70, 70, 20, 20, 0, Action * 360 / GameConstants.LimitAts);
                }
                else
                {
                    //画行动槽
                    g.FillPie(CanAttack ? Brushes.Yellow : Brushes.LightGray, 65, 65, 30, 30, 0, Action * 360 / GameConstants.LimitAts);
                }

                var starIcon = HSIcons.GetIconsByEName("sysstar");
                for (int i = 0; i < Avatar.MonsterConfig.Star; i++)
                {
                    g.DrawImage(starIcon, i * 12, 8, 16, 16);
                }

                g.DrawString(Level.ToString(), fontLevel, Brushes.Wheat, Level < 10 ? 71 : 67, 68);
                g.DrawString(Level.ToString(), fontLevel, Brushes.DarkBlue, Level < 10 ? 70 : 66, 67);
                font2.Dispose();
                fontLevel.Dispose();

                if (Weapon != null)
                {
                    g.DrawImage(Weapon.GetImage(32, 32), 5, 60, 32, 32);
                    g.DrawRectangle(Pens.Lime, 5, 60, 32, 32);
                }
                BuffManager.DrawBuff(g, roundPast / 20);
            }
            else
            {
                Image img = PicLoader.Read("System", "Rip.PNG");
                g.DrawImage(img, 19, 11, 63, 78);
                img.Dispose();

                var pen = new Pen(!IsLeft ? Brushes.Blue : Brushes.Red, 3);
                g.DrawRectangle(pen, 1, 1, 98, 98);
                pen.Dispose();

                g.FillRectangle(Brushes.Red, 0, 2, 100, 5);
                g.FillRectangle(Brushes.Cyan, 0, 2, Math.Min(GhostTime * 100, 100), 5);
            }

            g.Dispose();
            int size = BattleManager.Instance.MemMap.CardSize;

            g2.DrawImage(image, new Rectangle(Position.X, Position.Y, size, size), 0, 0, 100, 100, GraphicsUnit.Pixel);
            image.Dispose();
        }
コード例 #6
0
        private void EquipmentForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            Font font = new Font("黑体", 12*1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
            e.Graphics.DrawString("角色", font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();

            Image back = PicLoader.Read("System", "HeroBackNew1.JPG");
            e.Graphics.DrawImage(back, 20, 36, 512, 340);
            back.Dispose();

            if (!show)
                return;

            if (vRegion != null)
            {
                vRegion.Draw(e.Graphics);
            }

            JobConfig jobConfig = ConfigDatas.ConfigData.GetJobConfig(UserProfile.InfoBasic.Job);
            Image body = PicLoader.Read("Hero", string.Format("{0}.JPG", jobConfig.JobIndex));
            e.Graphics.DrawImage(body, 25, 47, 111, 111);
            body.Dispose();

            e.Graphics.FillRectangle(Brushes.LightSlateGray, 92, 113, 42, 42);
            Image head = PicLoader.Read("Player", string.Format("{0}.PNG", UserProfile.InfoBasic.Face));
            e.Graphics.DrawImage(head, 93, 114, 40, 40);
            head.Dispose();

            font = new Font("宋体", 11*1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            Font font2 = new Font("宋体", 10*1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            Font font3 = new Font("宋体", 9*1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            string namestr = string.Format("{0}(Lv{1}{2})", UserProfile.ProfileName, UserProfile.InfoBasic.Level, ConfigData.GetJobConfig(UserProfile.InfoBasic.Job).Name);
            e.Graphics.DrawString(namestr, font, Brushes.White, GetX(e.Graphics, namestr, font, 182, 130), 61);

            Brush brush = new SolidBrush(Color.FromArgb(180, Color.DimGray));
            for (int i = 0; i < 4; i++)
            {
                e.Graphics.FillRectangle(brush, 147 + 53 * i, 136, 45, 15);
                e.Graphics.FillRectangle(brush, 147 + 53 * i, 199, 45, 15);
            }
            brush.Dispose();

            string expstr = string.Format("{0}/{1}", UserProfile.InfoBasic.Exp, ExpTree.GetNextRequired(UserProfile.InfoBasic.Level));
            e.Graphics.DrawString(expstr, font2, Brushes.White, GetX(e.Graphics, expstr, font2, 38, 68), 161);
            e.Graphics.FillRectangle(Brushes.DimGray, 31, 178, 80, 2);
            e.Graphics.FillRectangle(Brushes.DodgerBlue, 31, 178, Math.Min(UserProfile.InfoBasic.Exp * 79 / ExpTree.GetNextRequired(UserProfile.InfoBasic.Level) + 1, 80), 2);

            DrawAttr(e.Graphics, font, heroData.Atk + vEquip.Atk, 147, 136);
            DrawAttr(e.Graphics, font, heroData.Hp + vEquip.Hp, 147 + 53, 136);
            DrawAttr(e.Graphics, font, heroData.Spd + vEquip.Spd, 147 + 53*2, 136);
            DrawAttr(e.Graphics, font, heroData.Range + vEquip.Range, 147 + 53 * 3, 136);

            DrawAttr(e.Graphics, font, vEquip.LpRate + jobInfo.Lp, 147, 199);
            DrawAttr(e.Graphics, font, vEquip.PpRate + jobInfo.Pp, 147 + 53, 199);
            DrawAttr(e.Graphics, font, vEquip.MpRate + jobInfo.Mp, 147 + 53 * 2, 199);

            font.Dispose();
            font2.Dispose();
            font3.Dispose();

            e.Graphics.DrawImage(tempImage, 361, 222);
        }
コード例 #7
0
ファイル: CardSlot.cs プロジェクト: jayrulez/TOMClassic
        private void Draw(Graphics g, CardMouseState mouse)
        {
            if (Card is SpecialCard)
            {
                //   Image img2 = Card.GetCardImage(120, 120);
                //   g.DrawImage(img2, new Rectangle(Location.X, 10, 120, 120), 0, 0, img2.Width, img2.Height, GraphicsUnit.Pixel);
                return;
            }

            int        x       = Location.X;
            int        y       = Location.Y;
            Color      bgColor = IsSelected ? Color.LightGreen : BgColor;
            SolidBrush sb      = new SolidBrush(bgColor);

            g.FillRectangle(sb, new Rectangle(x, y, Size.Width, Size.Height));
            sb.Dispose();
            if (mouse != CardMouseState.MouseOn)
            {
                y += 10;
            }
            CardAssistant.DrawBase(g, Card.CardId, x, y, Size.Width, 120);

            if (mouse == CardMouseState.Disable)
            {
                var sbrush = new SolidBrush(Color.FromArgb(150, Color.Black));
                g.FillRectangle(sbrush, x, y, Size.Width, 120);
                sbrush.Dispose();
            }
            if (ACard.Combo && CardConfigManager.GetCardConfig(ACard.CardId).Remark.Contains("连击"))
            {
                Image img = PicLoader.Read("System", "CardEff1.PNG");
                g.DrawImage(img, x + 2, y + 2, Size.Width - 4, 120 - 4);
                img.Dispose();
            }

            Font font = new Font("Arial", 7 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

            for (int i = 0; i < Card.Star; i++)
            {
                g.DrawString("★", font, Brushes.Black, x + Size.Width - 16, y + 2 + i * 10);
                g.DrawString("★", font, Brushes.Yellow, x + Size.Width - 15, y + 1 + i * 10);
            }
            font.Dispose();

            var cardData = CardConfigManager.GetCardConfig(Card.CardId);

            if (Card.GetCardType() == CardTypes.Monster)
            {
                g.DrawImage(HSIcons.GetIconsByEName("rac" + cardData.TypeSub), x + Size.Width / 2 - 18, y + 90, 16, 16);
            }
            else if (Card.GetCardType() == CardTypes.Weapon)
            {
                g.DrawImage(HSIcons.GetIconsByEName("wep" + (cardData.TypeSub - 100 + 1)), x + Size.Width / 2 - 18, y + 90, 16, 16);
            }
            else if (Card.GetCardType() == CardTypes.Spell)
            {
                g.DrawImage(HSIcons.GetIconsByEName("spl" + (cardData.TypeSub - 200 + 1)), x + Size.Width / 2 - 18, y + 90, 16, 16);
            }
            g.DrawImage(HSIcons.GetIconsByEName("atr" + cardData.Attr), x + Size.Width / 2 + 2, y + 90, 16, 16);

            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            var cardName  = string.Format("{0}Lv{1}", Card.Name, ACard.Level);
            var cardQual  = Config.CardConfigManager.GetCardConfig(Card.CardId).Quality;
            var cardColor = Color.FromName(HSTypes.I2QualityColor(cardQual));
            var brush     = new SolidBrush(cardColor);

            g.DrawString(cardName, font, Brushes.Black, x + 1, mouse != CardMouseState.MouseOn ? y + 107 : y + 112);
            g.DrawString(cardName, font, brush, x, mouse != CardMouseState.MouseOn ? y + 106 :y + 111);
            font.Dispose();
            brush.Dispose();

            int index = 0;

            foreach (var manaType in ACard.CostList)
            {
                var imgIcon = HSIcons.GetIconsByEName("mix" + (int)manaType);
                g.DrawImage(imgIcon, x + index * 10, y + 1, 16, 16);
                index++;
            }
            if (index == 0)//无消耗
            {
                font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                g.DrawString("无消耗", font, Brushes.White, x + index * 10 + 2, y + 1 + 2);
                font.Dispose();
            }
        }
コード例 #8
0
ファイル: ItemForm.cs プロジェクト: jayrulez/TOMClassic
        private void ItemForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            Font font = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            e.Graphics.DrawString("我的物品", font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();

            if (!show)
            {
                return;
            }

            if (isDirty)
            {
                tempImage.Dispose();
                tempImage = new Bitmap(324, 324);
                Graphics g   = Graphics.FromImage(tempImage);
                Image    img = PicLoader.Read("System", "ItemBackDown.JPG");
                g.DrawImage(img, 0, 0, 324, 324);
                img.Dispose();
                font = new Font("Aril", 11 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
                for (int i = 0; i < 100; i++)
                {
                    int imul = i / 10;
                    if (baseid + i < UserProfile.InfoBag.BagCount)
                    {
                        IntPair thing = UserProfile.InfoBag.Items[baseid + i];
                        if (thing.Type != 0)
                        {
                            var itemConfig = ConfigData.GetHItemConfig(thing.Type);
                            g.DrawImage(HItemBook.GetHItemImage(thing.Type), (i % 10) * 31.2F + 5, imul * 31.8F + 3, 30.0F, 30.0F);
                            g.DrawString(thing.Value.ToString(), font, Brushes.Black, (i % 10) * 31.2F + 8, imul * 31.8F + 14);
                            g.DrawString(thing.Value.ToString(), font, thing.Value == itemConfig.MaxPile ? Brushes.Tomato : Brushes.White, (i % 10) * 31.2F + 7, imul * 31.8F + 13);

                            var pen = new Pen(Color.FromName(HSTypes.I2RareColor(itemConfig.Rare)), 2);
                            g.DrawRectangle(pen, (i % 10) * 31.2F + 5, imul * 31.8F + 3, 30.0F, 30.0F);
                            pen.Dispose();
                        }
                    }
                    else
                    {
                        g.DrawImage(HSIcons.GetIconsByEName("oth3"), (i % 10) * 31.2F + 8, imul * 31.8F + 4, 24.0F, 24.0F);
                    }
                }
                font.Dispose();
                g.Dispose();
                isDirty = false;
            }
            e.Graphics.DrawImage(tempImage, 6, 36);
            int rect = tar;

            if (rect >= 0)
            {
                if (baseid + rect < UserProfile.InfoBag.BagCount)
                {
                    SolidBrush yellowbrush = new SolidBrush(Color.FromArgb(80, Color.Yellow));
                    e.Graphics.FillRectangle(yellowbrush, (rect % 10) * 31.2F + 11, (rect / 10) * 31.8F + 39, 30.0F, 30.0F);
                    yellowbrush.Dispose();

                    Pen yellowpen = new Pen(Brushes.Yellow, 2);
                    e.Graphics.DrawRectangle(yellowpen, (rect % 10) * 31.2F + 11, (rect / 10) * 31.8F + 39, 30.0F, 30.0F);
                    yellowpen.Dispose();
                }
                else
                {
                    int tpoff = rect;
                    while (tpoff >= 0 && baseid + tpoff >= UserProfile.InfoBag.BagCount)
                    {
                        e.Graphics.DrawImage(HSIcons.GetIconsByEName("oth4"), (tpoff % 10) * 31.2F + 14, (tpoff / 10) * 31.8F + 40, 24F, 24F);
                        tpoff--;
                    }
                }
            }
        }
コード例 #9
0
ファイル: Scene.cs プロジェクト: jayrulez/TOMClassic
        public void Paint(Graphics g)
        {
            g.DrawImage(backPicture, 0, 50, width, height - 35);
            g.DrawImage(mainTop, 0, 0, width, 50);
            g.DrawImage(mainTopRes, (width - 688) / 2, 4, 688, 37);//688是图片尺寸
            g.DrawImage(mainTopTitle, width - 145, 3, 115, 32);
            g.DrawImage(mainBottom, 0, height - 35, width, 35);

            if (UserProfile.Profile == null || UserProfile.InfoBasic.MapId == 0)
            {
                return;
            }

            Font font  = new Font("微软雅黑", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
            Font font2 = new Font("宋体", 9 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            Image head = PicLoader.Read("Player", string.Format("{0}.PNG", UserProfile.InfoBasic.Face));

            g.DrawImage(head, 0, 0, 50, 50);
            head.Dispose();
            g.DrawString(UserProfile.InfoBasic.Level.ToString(), font2, Brushes.Black, 3, 3);
            g.DrawString(UserProfile.InfoBasic.Level.ToString(), font2, Brushes.White, 2, 2);
            // g.DrawString(UserProfile.ProfileName, font, Brushes.White, 50, 10);

            LinearGradientBrush b1 = new LinearGradientBrush(new Rectangle(55, 5, 100, 5), Color.LightCoral, Color.Red, LinearGradientMode.Horizontal);

            g.FillRectangle(b1, 55, 5, Math.Min(UserProfile.InfoBasic.HealthPoint, 100), 5);
            g.DrawRectangle(Pens.DarkGray, 55, 5, 100, 5);
            b1.Dispose();

            b1 = new LinearGradientBrush(new Rectangle(55, 12, 100, 5), Color.LightBlue, Color.Blue, LinearGradientMode.Horizontal);
            g.FillRectangle(b1, 55, 12, Math.Min(UserProfile.InfoBasic.MentalPoint, 100), 5);
            g.DrawRectangle(Pens.DarkGray, 55, 12, 100, 5);
            b1.Dispose();

            b1 = new LinearGradientBrush(new Rectangle(55, 19, 100, 5), Color.LightGreen, Color.Green, LinearGradientMode.Horizontal);
            g.FillRectangle(b1, 55, 19, Math.Min(UserProfile.InfoBasic.FoodPoint, 100), 5);
            g.DrawRectangle(Pens.DarkGray, 55, 19, 100, 5);
            b1.Dispose();

            if (TimeMinutes >= 960 && TimeMinutes < 1080)
            {
                Brush yellow = new SolidBrush(Color.FromArgb(50, 255, 200, 0));
                g.FillRectangle(yellow, 0, 50, width, height);
                yellow.Dispose();
            }
            else if (TimeMinutes < 360 || TimeMinutes >= 1080) //18点到6点
            {
                Brush blue = new SolidBrush(Color.FromArgb(120, 0, 0, 150));
                g.FillRectangle(blue, 0, 50, width, height);
                blue.Dispose();
            }

            int len = (int)g.MeasureString(sceneName, font).Width;

            g.DrawString(sceneName, font, Brushes.White, new PointF(width - 85 - len / 2, 8));

            int xOff = (width - 688) / 2 + 103;

            g.DrawString(UserProfile.InfoBag.Resource.Lumber.ToString(), font, Brushes.White, new PointF(xOff, 13));
            g.DrawString(UserProfile.InfoBag.Resource.Stone.ToString(), font, Brushes.White, new PointF(xOff + 82, 13));
            g.DrawString(UserProfile.InfoBag.Resource.Mercury.ToString(), font, Brushes.White, new PointF(xOff + 82 * 2, 13));
            g.DrawString(UserProfile.InfoBag.Resource.Carbuncle.ToString(), font, Brushes.White, new PointF(xOff + 82 * 3, 13));
            g.DrawString(UserProfile.InfoBag.Resource.Sulfur.ToString(), font, Brushes.White, new PointF(xOff + 82 * 4, 13));
            g.DrawString(UserProfile.InfoBag.Resource.Gem.ToString(), font, Brushes.White, new PointF(xOff + 82 * 5, 13));
            g.DrawString(UserProfile.InfoBag.Resource.Gold.ToString(), font, Brushes.White, new PointF(xOff + 82 * 6, 13));

            xOff = (width - 688) / 2 + 30;
            g.FillRectangle(Brushes.DimGray, xOff, 41, 630, 8);
            b1 = new LinearGradientBrush(new Rectangle(xOff, 41, 630, 8), Color.White, Color.Gray, LinearGradientMode.Vertical);
            g.FillRectangle(b1, xOff, 41, Math.Min(UserProfile.InfoBasic.Exp * 630 / ExpTree.GetNextRequired(UserProfile.InfoBasic.Level), 630), 8);
            g.DrawRectangle(new Pen(Brushes.Black, 2), xOff, 41, 630, 8);
            b1.Dispose();

            font.Dispose();
            font2.Dispose();

            g.DrawImage(miniMap, width - 160, 43, 150, 150);
            g.DrawImage(miniBack, width - 190, 38, 185, 160);

            vRegion.Draw(g);

            DrawCellAndToken(g);
        }
コード例 #10
0
 public TournamentViewForm()
 {
     InitializeComponent();
     this.bitmapButtonClose.ImageNormal = PicLoader.Read("ButtonBitmap", "CloseButton1.JPG");
 }
コード例 #11
0
 public SystemSetup()
 {
     InitializeComponent();
     this.bitmapButtonClose.ImageNormal = PicLoader.Read("Button.Panel", "closebutton1.jpg");
     bitmapButtonClose.NoUseDrawNine    = true;
 }