예제 #1
0
        private void SelectJobForm_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();

            jobDes.Draw(e.Graphics);
            virtualRegion.Draw(e.Graphics);

            if (selectJobId > 0)
            {
                var  jobConfig = ConfigData.GetJobConfig(selectJobId);
                Font font1     = new Font("宋体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
                e.Graphics.DrawString(jobConfig.Name, font1, Brushes.Gold, 180, 45);
                font1.Dispose();

                Font fontDes = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                e.Graphics.DrawString("领导", fontDes, Brushes.White, 180, 175);
                e.Graphics.DrawString(GetStarText(jobConfig.EnergyRate[0] / 8 + 1), fontDes, Brushes.Gold, 210, 175);
                e.Graphics.DrawString("力量", fontDes, Brushes.White, 180, 195);
                e.Graphics.DrawString(GetStarText(jobConfig.EnergyRate[1] / 8 + 1), fontDes, Brushes.Red, 210, 195);
                e.Graphics.DrawString("魔力", fontDes, Brushes.White, 180, 215);
                e.Graphics.DrawString(GetStarText(jobConfig.EnergyRate[2] / 8 + 1), fontDes, Brushes.Blue, 210, 215);
                fontDes.Dispose();
            }

            e.Graphics.DrawRectangle(Pens.DodgerBlue, 8, 39, 153, 279);
            e.Graphics.DrawRectangle(Pens.DodgerBlue, 170, 38, 330, 125);
            e.Graphics.DrawRectangle(Pens.DodgerBlue, 170, 168, 330, 86);
            e.Graphics.DrawRectangle(Pens.DodgerBlue, 170, 259, 330, 59);
        }
예제 #2
0
        private void MazeWindow_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(ConfigDatas.ConfigData.GetNpcConfig(npcId).Name, font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();

            int xoff = 8;
            int yoff = 35;

            e.Graphics.DrawImage(mazeBack, new Rectangle(xoff, yoff, 380, 380), wx * 38, wy * 38, 380, 380, GraphicsUnit.Pixel);

            e.Graphics.DrawImage(hero, new Rectangle((x - wx) * 38 + xoff + 6, (y - wy) * 38 + yoff, 23, 35), heroAct * 23, last * 35, 23, 35, GraphicsUnit.Pixel);
            for (int i = wx; i < Math.Min(wx + 10, mazeState.GetLength(0) - 1); i++)
            {
                for (int j = wy; j < Math.Min(wy + 10, mazeState.GetLength(1) - 1); j++)
                {
                    Rectangle dest = new Rectangle((i - wx) * 38 + xoff, (j - wy) * 38 + yoff, 38, 38);
                    if (mazeState[i, j] != 4)
                    {
                        maze.DrawIcon(e.Graphics, dest, i, j, heroAct);
                    }
                }
            }
#if DEBUG
            e.Graphics.DrawString(string.Format("{0},{1}", x, y), new Font("宋体", 11), Brushes.Black, xoff, yoff);
#endif
            e.Graphics.DrawRectangle(Pens.White, xoff, yoff, 379, 379);
        }
예제 #3
0
        int IHeightAdaptable.CalcHeight(GraphicsCache cache, int width)
        {
            BorderObjectInfoArgs info = new BorderObjectInfoArgs(cache);

            info.Bounds = new Rectangle(0, 0, width, 100);
            Rectangle textRect = BorderPainter.GetObjectClientRectangle(info);

            if (!(BorderPainter is EmptyBorderPainter))
            {
                textRect.Inflate(-1, -1);
            }
            string text = string.Empty;

            text = DisplayText;
            if (text != null && text.Length > 0)
            {
                char lastChar = text[text.Length - 1];
                if (lastChar == 13 || lastChar == 10)
                {
                    text += "W";
                }
            }
            int height = CalcTextSizeCore(cache, text, textRect.Width).Height + 1;

            return((height + 100 - textRect.Bottom) + 1);
        }
예제 #4
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})", config.Name, eventLevel), font2, Brushes.White, Width / 2 - 40, 8);
                font2.Dispose();

                e.Graphics.DrawImage(SceneBook.GetSceneQuestImage(config.Id), 15, 40, 140, 140);
                Image border = PicLoader.Read("Border", "questb1.PNG"); //边框
                e.Graphics.DrawImage(border, 15, 40, 140, 140);
                border.Dispose();

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

                colorWord.Draw(e.Graphics);

                if (answerList != null && (evtItem == null || evtItem.RunningState != TalkEventItem.TalkEventState.Running))
                {
                    Font font = new Font("宋体", 11 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                    int  id   = 0;
                    foreach (var word in answerList)
                    {
                        if (id == tar)
                        {
                            e.Graphics.FillRectangle(Brushes.DarkBlue, 10, id * 20 + Height - 10 - answerList.Count * 20, Width - 20, 20);
                        }

                        int textOff = 20;
                        if (!string.IsNullOrEmpty(word.Prefix))
                        {
                            string icon = "";
                            if (word.Prefix.StartsWith("quest"))
                            {
                                icon = "npc5";
                            }
                            if (word.Prefix.StartsWith("rival"))
                            {
                                icon = "tsk1";
                            }
                            if (icon != "")
                            {
                                e.Graphics.DrawImage(HSIcons.GetIconsByEName(icon), textOff, id * 20 + Height - 10 - answerList.Count * 20 + 2, 18, 18);
                                textOff += 20;
                            }
                        }
                        e.Graphics.DrawString(word.Script, font, Brushes.Wheat, textOff, id * 20 + Height - 10 - answerList.Count * 20 + 2);

                        id++;
                    }
                    font.Dispose();
                }
            }
        }
예제 #5
0
        private void SystemMenu_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 - 30, 8);
            font.Dispose();
        }
예제 #6
0
        private void ConnectForm_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();
        }
예제 #7
0
    protected override BorderPainter GetBorderPainterCore()
    {
        BorderPainter bp = base.GetBorderPainterCore();

        if (bp is WindowsXPTextBorderPainter)
        {
            bp = new WindowsXPProgressBarBorderPainter();
        }
        return(bp);
    }
예제 #8
0
        private void MergeWeaponForm_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 (currentInfo == null)
            {
                return;
            }

            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            e.Graphics.DrawString(timeText, font, Brushes.YellowGreen, 165, 412);
            font.Dispose();

            int         targetid    = selectPanel.SelectInfo;
            EquipConfig equipConfig = ConfigData.GetEquipConfig(targetid);

            font = new Font("微软雅黑", 14 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
            e.Graphics.DrawString((GameResourceBook.OutStoneMerge(equipConfig.Quality + 1, equipConfig.Level)).ToString().PadLeft(5, ' '), font, PaintTool.GetBrushByResource((int)GameResourceType.Mercury), 273, 368);
            e.Graphics.DrawImage(HSIcons.GetIconsByEName("res3"), 333, 370, 24, 24);
            font.Dispose();

            font = new Font("微软雅黑", 10 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            int[] imgOff = { 200, 410, 270, 340 };
            int   index  = 1;

            foreach (var pair in currentInfo.Methods)
            {
                var   imgOffX = imgOff[index - 1];
                Brush brush   = new SolidBrush(Color.FromName(HSTypes.I2RareColor(ConfigData.GetHItemConfig(pair.Type).Rare)));
                e.Graphics.DrawString(ConfigData.GetHItemConfig(pair.Type).Name, font, brush, imgOffX, 305);
                brush.Dispose();

                var  itemCount = itemCounts[index];
                bool isEnough  = itemCount >= pair.Value;
                e.Graphics.DrawString(string.Format("{0}/{1}", itemCount, pair.Value), font, isEnough ? Brushes.Lime : Brushes.Red, imgOffX, 325);

                e.Graphics.DrawLine(isEnough ? Pens.Lime : Pens.Gray, 325, 160, imgOffX + 20, 295);

                index++;
            }
            font.Dispose();

            Image border = PicLoader.Read("Border", "itemb1.PNG");

            e.Graphics.DrawImage(border, 295 - 10, 100 - 15, 80, 90);
            border.Dispose();

            virtualRegion.Draw(e.Graphics);
        }
예제 #9
0
        private void BattleForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            vRegion.Draw(e.Graphics);

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

            e.Graphics.DrawString(" 模拟战斗 ", font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();
        }
예제 #10
0
        private void CreatePlayerForm_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();

            e.Graphics.DrawImage(HSIcons.GetIconsByEName(string.Format("con{0}", constellation + 1)), 141, 159, 24, 24);
            e.Graphics.DrawImage(HSIcons.GetIconsByEName(string.Format("atr{0}", type)), 141, 192, 24, 24);
            e.Graphics.DrawImage(HSIcons.GetIconsByEName(string.Format("bld{0}", bldType + 1)), 141, 225, 24, 24);
        }
예제 #11
0
        private void LevelInfoForm_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();

            foreach (LevelInfoItem ctl in infoControls)
            {
                ctl.Draw(e.Graphics);
            }
        }
예제 #12
0
        private void CardViewForm_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();

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

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

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

            if (show)
            {
                int pages     = cards.Count / cardCount + 1;
                int cardLimit = (page < pages - 1) ? cardCount : (cards.Count % 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++)
                    {
                        int ri = i % (xCount * yCount);
                        int x  = (ri % xCount) * cardWidth;
                        int y  = (ri / xCount) * cardHeight;
                        DrawOnCardView(g, cards[i], x, y, false);
                    }
                    g.Dispose();
                    isDirty = false;
                }
                e.Graphics.DrawImage(tempImage, 65, 110);
                if (tar != -1 && tar < cards.Count)
                {
                    int ri = tar % (xCount * yCount);
                    int x  = (ri % xCount) * cardWidth + 65;
                    int y  = (ri / xCount) * cardHeight + 110;
                    DrawOnCardView(e.Graphics, cards[tar], x, y, true);
                }
            }
        }
예제 #13
0
        private void BuyPieceForm_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();

            colorWord.Draw(e.Graphics);
            foreach (PieceItem ctl in pieceControls)
            {
                ctl.Draw(e.Graphics);
            }
        }
예제 #14
0
        private void ItemPackageForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            Image img = PicLoader.Read("System", "ItemBackDown2.JPG");

            e.Graphics.DrawImage(img, 10, 35, 185, 185);
            img.Dispose();

            vRegion.Draw(e.Graphics);

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

            e.Graphics.DrawString("礼 包", font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();
        }
예제 #15
0
        private void AchieveViewForm_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();

            virtualRegion.Draw(e.Graphics);

            foreach (AchieveItem ctl in achieveControls)
            {
                ctl.Draw(e.Graphics);
            }
        }
예제 #16
0
        private void MagicBookViewForm_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, 300, 8);
            font.Dispose();

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

            e.Graphics.DrawImage(back, 5, 35, 672, 420);
            back.Dispose();

            virtualRegion.Draw(e.Graphics);
        }
예제 #17
0
        private void BlessViewForm_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();

            foreach (var ctl in blessControls)
            {
                ctl.Draw(e.Graphics);
            }

            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            e.Graphics.DrawString(timeText, font, Brushes.YellowGreen, 445, 375);
            font.Dispose();
        }
예제 #18
0
        private void CardShopViewForm_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();

            vRegion.Draw(e.Graphics);
            foreach (CardShopItem ctl in itemControls)
            {
                ctl.Draw(e.Graphics);
            }
            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            e.Graphics.DrawString(timeText, font, Brushes.YellowGreen, 18, 447);
            font.Dispose();
        }
예제 #19
0
        protected void DrawBase(Graphics g)
        {
            BorderPainter.Draw(g, "", Width, Height);

            if (!show)
            {
                return;
            }

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

            g.DrawString(config.Name, font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();

            if (backImage != null)
            {
                g.DrawImage(backImage, xoff, yoff, 324, 244);
            }
        }
예제 #20
0
        private void MergeWeaponForm_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();

            font = new Font("宋体", 11 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
            if (tid == 0)
            {
                e.Graphics.DrawString("排名", font, Brushes.LightCyan, 215, 50);
                e.Graphics.DrawString("名字", font, Brushes.LightCyan, 325, 50);
                e.Graphics.DrawString("等级", font, Brushes.LightCyan, 400, 50);
                e.Graphics.DrawString("职业", font, Brushes.LightCyan, 450, 50);
                e.Graphics.DrawString("积分", font, Brushes.LightCyan, 560, 50);
            }
            else
            {
                //Tournament tour = TournamentBook.GetTournament(tid);
                //if (tour.begin_date <= UserProfile.Profile.time.Date && tour.end_date >= UserProfile.Profile.time.Date)
                //{
                //    e.Graphics.DrawString("比赛中", font, Brushes.Gold, 250, 50);
                //}
                //else if (tour.apply_date != UserProfile.Profile.time.Date)
                //{
                //    e.Graphics.DrawString("报名时间", font, Brushes.LightGray, 200, 50);
                //    e.Graphics.DrawString(HSTime.GetByDate(tour.apply_date).ToShortString(), font, Brushes.LightGreen, 266, 50);
                //}
                //else if (UserProfile.MemData.GetTournamentData(tid).engage)
                //{
                //    e.Graphics.DrawString("已报名", font, Brushes.Lime, 250, 50);
                //}
                //else if (UserProfile.Profile.level < tour.min_level || UserProfile.Profile.level > tour.max_level)
                //{
                //    e.Graphics.DrawString("等级限制", font, Brushes.Red, 250, 50);
                //}
            }
            font.Dispose();
            e.Graphics.DrawLine(Pens.White, 200, 70, 700, 70);
        }
예제 #21
0
        private void RoleForm_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(UserProfile.Profile.Name, font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();

            if (!show)
            {
                return;
            }
            e.Graphics.FillRectangle(Brushes.LightSlateGray, 25 - 1, 55 - 1, 52, 52);
            Image head = PicLoader.Read("Player", string.Format("{0}.png", UserProfile.InfoBasic.Head));

            e.Graphics.DrawImage(head, 25, 55, 50, 50);
            head.Dispose();

            font = new Font("宋体", 11 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            Font font2 = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

            Brush brush = new SolidBrush(Color.FromArgb(220, Color.Black));

            e.Graphics.FillRectangle(brush, 12, 300, 305, 105);
            brush.Dispose();

            string namestr = string.Format("Lv {0}", UserProfile.InfoBasic.Level);

            e.Graphics.DrawString(namestr, font, Brushes.White, 20, 305);

            string expstr = string.Format("{0}/{1}", UserProfile.InfoBasic.Exp, ExpTree.GetNextRequired(UserProfile.InfoBasic.Level));

            e.Graphics.DrawString(expstr, font2, Brushes.White, 130, 300);
            e.Graphics.FillRectangle(Brushes.DimGray, 80, 314, 180, 4);
            e.Graphics.FillRectangle(Brushes.DodgerBlue, 80, 314, Math.Min(UserProfile.InfoBasic.Exp * 179 / ExpTree.GetNextRequired(UserProfile.InfoBasic.Level) + 1, 180), 4);

            font.Dispose();
            font2.Dispose();
        }
        private void GridView_AttendanceData_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
        {
            if (IsInvalidValue(e.Info.Value))
            {
                int       dx    = e.Bounds.Height;
                Brush     brush = e.Cache.GetGradientBrush(e.Bounds, Color.Wheat, Color.FloralWhite, LinearGradientMode.Vertical);
                Rectangle r     = e.Bounds;
                //Draw a 3D border
                BorderPainter    painter          = BorderHelper.GetPainter(DevExpress.XtraEditors.Controls.BorderStyles.Style3D);
                AppearanceObject borderAppearance = new AppearanceObject(e.Appearance)
                {
                    BorderColor = Color.DarkGray
                };
                painter.DrawObject(new BorderObjectInfoArgs(e.Cache, borderAppearance, r));
                //Fill the inner region of the cell
                r.Inflate(-1, -1);
                e.Cache.FillRectangle(brush, r);
                //Draw a summary value
                r.Inflate(-2, 0);
                e.Appearance.DrawString(e.Cache, e.Info.DisplayText, r);
                //Prevent default drawing of the cell
                e.Handled = true;

                /*
                 * StringFormat format = new StringFormat();
                 * format.Alignment = StringAlignment.Near;
                 * Rectangle r = e.Bounds;
                 * r.Inflate(-2, 0);
                 * Font f = new System.Drawing.Font("Tahoma", 8.25f, FontStyle.Bold);
                 *
                 * e.Appearance.BackColor = Color.FromArgb(50, 255, 0, 0);
                 * e.Appearance.DrawString(e.Cache, e.Info.DisplayText, r, f, format);
                 */
                /*
                 * e.Appearance.BackColor = Color.FromArgb(50, 255, 0, 0);
                 * e.Appearance.FillRectangle(e.Cache, e.Bounds);
                 * e.Info.AllowDrawBackground = false;
                 */
            }
        }
예제 #23
0
        private void PeopleViewForm_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 (showImage)
            {
                virtualRegion.Draw(e.Graphics);

                if (realTar != -1)
                {
                    int          xoff         = 35;
                    int          yoff         = 35;
                    Font         fontsong     = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                    PeopleConfig peopleConfig = ConfigData.GetPeopleConfig(people[realTar].Pid);
                    e.Graphics.DrawString(string.Format("{0} (Lv{1})", peopleConfig.Name, peopleConfig.Level), fontsong, Brushes.White, xoff + 100, yoff + 10);
                    e.Graphics.DrawString("来自", fontsong, Brushes.DarkGray, xoff + 100, yoff + 28);
                    e.Graphics.DrawString(peopleConfig.World, fontsong, Brushes.Cyan, xoff + 140, yoff + 28);
                    e.Graphics.DrawString("属性", fontsong, Brushes.DarkGray, xoff + 100, yoff + 46);
                    for (int i = 0; i < peopleConfig.Deck.Length; i++)
                    {
                        e.Graphics.DrawImage(HSIcons.GetIconsByEName(peopleConfig.Deck[i]), xoff + 140 + i * 18, yoff + 46, 16, 16);
                    }
                    int win  = people[realTar].Win;
                    int loss = people[realTar].Loss;
                    int rate = 0;
                    if (win + loss != 0)
                    {
                        rate = win * 100 / (win + loss);
                    }
                    e.Graphics.DrawString("胜率", fontsong, Brushes.DarkGray, xoff + 100, yoff + 64);
                    e.Graphics.DrawString(string.Format("{0:0.0}% ({1}胜{2}负)", rate, win, loss), fontsong, (win == loss) ? Brushes.White : (win > loss ? Brushes.LightGreen : Brushes.Red), xoff + 140, yoff + 64);
                    fontsong.Dispose();
                }
            }
        }
예제 #24
0
        private void CardBagForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            for (int i = 0; i < cardCount; i++)
            {
                var pickCardId = cardOpenArray[i];
                int tx         = cardPos[i * 2];
                int ty         = cardPos[i * 2 + 1];
                if (pickCardId > 0)
                {
                    CardAssistant.DrawBase(e.Graphics, pickCardId, tx, ty, 120, 150);

                    var  cardConfigData = CardConfigManager.GetCardConfig(pickCardId);
                    Font fontStar       = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                    e.Graphics.DrawString(("★★★★★★★★★★").Substring(10 - cardConfigData.Star), fontStar, Brushes.Yellow, tx + 5, ty + 10);
                    fontStar.Dispose();
                    var quality = cardConfigData.Quality + 1;
                    e.Graphics.DrawImage(HSIcons.GetIconsByEName("gem" + quality), tx + 50, ty + 125, 20, 20);
                }
                else
                {
                    var imgBack = PicLoader.Read("System", "CardBack.JPG");
                    e.Graphics.DrawImage(imgBack, tx, ty, 120, 150);
                }

                if (coverEffect[i] != null)
                {
                    coverEffect[i].Draw(e.Graphics);
                }
            }

            vRegion.Draw(e.Graphics);

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

            e.Graphics.DrawString("卡 包", font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();
        }
예제 #25
0
        private void HeroSkillAttrForm_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();

            foreach (HeroSkillAttrItem ctl in skillControls)
            {
                ctl.Draw(e.Graphics);
            }

            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            string str    = string.Format("我的阅历:  {0} ", UserProfile.InfoBasic.AttrPoint);
            int    strWid = (int)e.Graphics.MeasureString(str, font).Width;

            e.Graphics.DrawString(str, font, Brushes.White, 20, 290);
            font.Dispose();
            e.Graphics.DrawImage(HSIcons.GetIconsByEName("oth6"), 20 + strWid, 289, 14, 14);
        }
예제 #26
0
        private void GameShopViewForm_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();

            virtualRegion.Draw(e.Graphics);
            foreach (GameShopItem ctl in itemControls)
            {
                ctl.Draw(e.Graphics);
            }

            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            string str    = string.Format("我的钻石:  {0} ", UserProfile.InfoBag.Diamond);
            int    strWid = (int)e.Graphics.MeasureString(str, font).Width;

            e.Graphics.DrawString(str, font, Brushes.White, 20, 372);
            font.Dispose();
            e.Graphics.DrawImage(HSIcons.GetIconsByEName("res8"), 20 + strWid, 371, 14, 14);
        }
예제 #27
0
        int IHeightAdaptable.CalcHeight(GraphicsCache cache, int width)
        {
            width -= ((MyRepositoryItemMemoEdit)Item).ContentImageSize.Width;
            BorderObjectInfoArgs info = new BorderObjectInfoArgs(cache);

            info.Bounds = new Rectangle(0, 0, width, 100);
            Rectangle textRect = BorderPainter.GetObjectClientRectangle(info);

            if (!(BorderPainter is EmptyBorderPainter) && !(BorderPainter is InplaceBorderPainter))
            {
                textRect.Inflate(-1, -1);
            }
            string text = string.Empty;

            if (Item.LinesCount == 0)
            {
                text = DisplayText;
                if (text != null && text.Length > 0)
                {
                    char lastChar = text[text.Length - 1];
                    if (lastChar == 13 || lastChar == 10)
                    {
                        text += "W";
                    }
                }
            }
            else
            {
                for (int i = 0; i < Item.LinesCount; i++)
                {
                    text += (string.IsNullOrEmpty(text) ? "" : Environment.NewLine) + "W";
                }
            }
            int height1 = CalcTextSizeCore(cache, text, textRect.Width).Height + 1;

            return((height1 + 100 - textRect.Bottom) + 1);
        }
예제 #28
0
        private void DeckViewForm_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();

            try
            {
                if (show)
                {
                    if (!isShowStatistic)
                    {
                        cardDetail.Draw(e.Graphics);
                    }
                    else
                    {
                        deckStatistic.Draw(e.Graphics);
                    }
                    cardRegion.Draw(e.Graphics);
                    selectRegion.Draw(e.Graphics);

                    virtualRegion.Draw(e.Graphics);

                    font = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
                    e.Graphics.DrawString(UserProfile.InfoCard.SelectedDeck.Name, font, Brushes.White, 5, 580);
                    font.Dispose();
                }
            }
            catch (Exception ex)
            {
                NLog.Error("DeckViewForm_Paint" + ex);
            }
        }
예제 #29
0
 private void GridView_SalaryProcess_CustomDrawFooterCell(object sender, DevExpress.XtraGrid.Views.Grid.FooterCellCustomDrawEventArgs e)
 {
     if (IsInvalidValue(e.Info.Value))
     {
         int       dx    = e.Bounds.Height;
         Brush     brush = e.Cache.GetGradientBrush(e.Bounds, Color.Wheat, Color.FloralWhite, LinearGradientMode.Vertical);
         Rectangle r     = e.Bounds;
         //Draw a 3D border
         BorderPainter    painter          = BorderHelper.GetPainter(DevExpress.XtraEditors.Controls.BorderStyles.Style3D);
         AppearanceObject borderAppearance = new AppearanceObject(e.Appearance)
         {
             BorderColor = Color.DarkGray
         };
         painter.DrawObject(new BorderObjectInfoArgs(e.Cache, borderAppearance, r));
         //Fill the inner region of the cell
         r.Inflate(-1, -1);
         e.Cache.FillRectangle(brush, r);
         //Draw a summary value
         r.Inflate(-2, 0);
         e.Appearance.DrawString(e.Cache, e.Info.DisplayText, r);
         //Prevent default drawing of the cell
         e.Handled = true;
     }
 }
예제 #30
0
        private void WorldMapViewForm_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 (!showImage)
            {
                return;
            }

            e.Graphics.DrawImage(worldMap, new Rectangle(15, 35, 750, 500), new Rectangle(baseX, baseY, 750, 500), GraphicsUnit.Pixel);
            Image tit = PicLoader.Read("Map", "title.PNG");

            e.Graphics.DrawImage(tit, 30, 45, 126, 44);
            tit.Dispose();
            foreach (var mapIconConfig in ConfigData.SceneDict.Values)
            {
                if (mapIconConfig.Icon == "")
                {
                    continue;
                }

                if (mapIconConfig.Icon == selectName)
                {
                    var iconSize = iconSizeDict[mapIconConfig.Id];
                    int x        = mapIconConfig.IconX;
                    int y        = mapIconConfig.IconY;
                    int width    = iconSize.Width;
                    int height   = iconSize.Height;

                    if (x > baseX && y > baseY && x + width < baseX + 750 && y + height < baseY + 500)
                    {
                        Image     image     = PicLoader.Read("MapIcon", string.Format("{0}.PNG", mapIconConfig.Icon));
                        Rectangle destRect  = new Rectangle(x - baseX + 11, y - baseY + 31, width + 8, height + 8);
                        Rectangle destRect2 = new Rectangle(x - baseX + 15, y - baseY + 35, width, height);
                        e.Graphics.DrawImage(image, destRect, 0, 0, width, height, GraphicsUnit.Pixel);
                        e.Graphics.DrawImage(image, destRect2, 0, 0, width, height, GraphicsUnit.Pixel);
                        image.Dispose();

                        image = GetPreview(mapIconConfig.Id);
                        int tx = x - baseX + width;
                        if (tx > 750 - image.Width)
                        {
                            tx -= image.Width + width;
                        }
                        e.Graphics.DrawImage(image, tx + 15, y - baseY + 35, image.Width, image.Height);
                        image.Dispose();
                    }
                }
                if (mapIconConfig.Id == UserProfile.InfoBasic.MapId)
                {
                    Image image = PicLoader.Read("Map", "arrow.PNG");
                    e.Graphics.DrawImage(image, mapIconConfig.IconX - baseX + 40, mapIconConfig.IconY - baseY - 5 + pointerY, 30, 48);
                    image.Dispose();
                }
            }
        }