示例#1
0
        public override Bitmap Render()
        {
            if (this.skill == null)
            {
                return(null);
            }

            int      picHeight;
            Bitmap   originBmp = RenderSkill(out picHeight);
            Bitmap   tooltip   = new Bitmap(290, picHeight);
            Graphics g         = Graphics.FromImage(tooltip);

            int iconY = 33;

            //复制图像
            g.FillRectangle(GearGraphics.GearBackBrush, 2, 2, 286, picHeight - 4);
            g.CompositingMode = CompositingMode.SourceCopy;
            g.FillRectangle(GearGraphics.GearIconBackBrush, 14, iconY, 68, 68);
            g.CompositingMode = CompositingMode.SourceOver;
            g.DrawImage(originBmp, 0, 0, new Rectangle(0, 0, 290, picHeight - 2), GraphicsUnit.Pixel);

            //边框
            g.DrawLines(GearGraphics.GearBackPen, GearGraphics.GetBorderPath(0, 290, picHeight));

            g.Dispose();
            return(tooltip);
        }
示例#2
0
        public override Bitmap Render()
        {
            if (this.item == null)
            {
                return(null);
            }
            int      picHeight, iconY;
            Bitmap   originBmp = renderItem(out picHeight, out iconY);
            Bitmap   tooltip   = new Bitmap(290, picHeight);
            Graphics g         = Graphics.FromImage(tooltip);

            //复制图像
            g.FillRectangle(GearGraphics.GearBackBrush, 2, 2, 286, picHeight - 4);
            g.CompositingMode = CompositingMode.SourceCopy;
            g.FillRectangle(GearGraphics.GearIconBackBrush, 14, iconY, 68, 68);
            g.CompositingMode = CompositingMode.SourceOver;
            g.DrawImage(originBmp, 0, 0, new Rectangle(0, 0, 290, picHeight - 2), GraphicsUnit.Pixel);
            //绘制外边框
            g.DrawLines(GearGraphics.GearBackPen, GearGraphics.GetBorderPath(0, 290, picHeight));

            //GearGraphics.DrawGearDetailNumber(g, 2, 2, item.ItemID.ToString("d8"), true);

            g.Dispose();
            return(tooltip);
        }
示例#3
0
        public override Bitmap Render()
        {
            if (this.gear == null)
            {
                return(null);
            }
            int    picHeight, iconY, picHeight2, picHeight3;
            Bitmap left = renderBase(out picHeight, out iconY);
            Bitmap add  = renderAddition(out picHeight2);
            Bitmap set  = renderSetItem(out picHeight3);

            //整合图像
            int width = 252;

            if (add != null)
            {
                width += 252;
            }
            if (set != null)
            {
                width += 252;
            }
            Bitmap   tooltip = new Bitmap(width, Math.Max(Math.Max(picHeight, picHeight2), picHeight3));
            Graphics g       = Graphics.FromImage(tooltip);
            bool     epic    = gear.Epic;

            width = 0;
            //绘制主图
            if (left != null)
            {
                g.FillRectangle(epic ? GearGraphics.EpicGearBackBrush : GearGraphics.GearBackBrush, 2, 2, 248, picHeight - 4);
                g.CompositingMode = CompositingMode.SourceCopy;
                g.FillRectangle(epic ? GearGraphics.EpicGearIconBackBrush : GearGraphics.GearIconBackBrush, 14, iconY, 68, 68);
                g.CompositingMode = CompositingMode.SourceOver;
                g.DrawImage(left, 0, 0, new Rectangle(0, 0, 252, picHeight - 2), GraphicsUnit.Pixel);
                //绘制外边框
                g.DrawLines(epic ? GearGraphics.EpicGearBackPen : GearGraphics.GearBackPen, GearGraphics.GetBorderPath(0, 252, picHeight));
                //绘制等级边框
                Pen pen = GearGraphics.GetGearItemBorderPen(gear.Grade);
                if (pen != null)
                {
                    g.DrawLines(pen, getRankBorderPath(picHeight));
                }
                width += 252;
            }

            //绘制addition
            if (add != null)
            {
                //底色和边框
                g.FillRectangle(epic ? GearGraphics.EpicGearBackBrush : GearGraphics.GearBackBrush, width + 2, 2, 248, picHeight - 4);
                g.DrawLines(epic ? GearGraphics.EpicGearBackPen : GearGraphics.GearBackPen, GearGraphics.GetBorderPath(width, 252, picHeight));
                //复制原图
                g.DrawImage(add, width, 0, new Rectangle(0, 0, 252, picHeight2), GraphicsUnit.Pixel);
                add.Dispose();
                width += 252;
            }

            //绘制setitem
            if (set != null)
            {
                //底色和边框
                g.FillRectangle(GearGraphics.GearBackBrush, width + 2, 2, 248, picHeight3 - 4);
                g.DrawLines(GearGraphics.GearBackPen, GearGraphics.GetBorderPath(width, 252, picHeight3));
                //复制原图
                g.DrawImage(set, width, 0, new Rectangle(0, 0, 252, picHeight3), GraphicsUnit.Pixel);
                set.Dispose();
                width += 252;
            }

            // GearGraphics.DrawGearDetailNumber(g, 2, 2, gear.ItemID.ToString("d8"), true);

            g.Dispose();

            return(tooltip);
        }