Ejemplo n.º 1
0
        /// <summary>
        /// 重绘单元格
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="rect">区域</param>
        /// <param name="clipRect">裁剪区域</param>
        /// <param name="isAlternate">是否交替</param>
        public override void OnPaint(CPaint paint, RECT rect, RECT clipRect, bool isAlternate)
        {
            base.OnPaint(paint, rect, clipRect, isAlternate);
            int width = rect.right - rect.left;

            if (width > 0)
            {
                width = (int)(width * m_rate / 100);
                int newRight = rect.left + width;
                if (clipRect.right > newRight)
                {
                    clipRect.right = newRight;
                }
                long pColor = COLOR.ARGB(100, 255, 0, 0);
                if (m_rate > 80)
                {
                    pColor = COLOR.ARGB(100, 0, 255, 0);
                }
                else if (m_rate > 60)
                {
                    pColor = COLOR.ARGB(100, 255, 255, 0);
                }
                else if (m_rate > 40)
                {
                    pColor = COLOR.ARGB(100, 0, 255, 255);
                }
                else if (m_rate > 20)
                {
                    pColor = COLOR.ARGB(100, 255, 0, 255);
                }
                paint.FillRect(pColor, clipRect);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 重绘背景方法
 /// </summary>
 /// <param name="paint">绘图对象</param>
 public void OnPaintBackground(CPaint paint)
 {
     if (m_k != 0 && m_b != 0)
     {
         RECT drawRect = new RECT(m_location.x - m_tick, m_location.y - m_tick, m_location.x + m_tick, m_location.y + m_tick);
         //paint.DrawGradientEllipse(m_backColor, COLOR.RatioColor(paint, m_backColor, 1.1), drawRect, 90);
         paint.DrawRoundRect(m_backColor, 1, 0, drawRect, 5);
         if (m_tick2 % 5 == 0)
         {
             if (m_mode == 0)
             {
                 m_tick++;
                 if (m_tick > 10)
                 {
                     m_mode = 1;
                 }
             }
             else if (m_mode == 1)
             {
                 m_tick--;
                 if (m_tick < 4)
                 {
                     m_mode = 0;
                 }
             }
         }
         m_tick2++;
         if (m_tick2 > 1000)
         {
             m_tick2 = 0;
         }
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 重绘前景方法
 /// </summary>
 /// <param name="paint">绘图对象</param>
 /// <param name="clipRect">裁剪区域</param>
 public override void OnPaintBackground(CPaint paint, RECT clipRect)
 {
     base.OnPaintBackground(paint, clipRect);
     lock (m_barrages)
     {
         int barragesSize = m_barrages.Count;
         for (int i = 0; i < barragesSize; i++)
         {
             Barrage brg  = m_barrages[i];
             FONT    font = brg.Font;
             RECT    rect = brg.Rect;
             String  str  = brg.Text;
             SIZE    size = paint.TextSize(str, font);
             rect.right  = rect.left + size.cx;
             rect.bottom = rect.top + size.cy;
             brg.Rect    = rect;
             long color = brg.Color;
             int  mode  = brg.Mode;
             if (mode == 1)
             {
                 int a = 0, r = 0, g = 0, b = 0;
                 COLOR.ToARGB(null, color, ref a, ref r, ref g, ref b);
                 a     = a * brg.Tick / 400;
                 color = COLOR.ARGB(a, r, g, b);
             }
             paint.DrawText(str, color, font, rect);
         }
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 重绘背景方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaintBackground(CPaint paint, RECT clipRect)
        {
            int  width = Width - 1, height = Height - 1;
            RECT drawRect = new RECT(0, 0, width, height);

            paint.FillRoundRect(GetPaintingBackColor(), drawRect, 4);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 绘制有下划线的数字
 /// </summary>
 /// <param name="paint">绘图对象</param>
 /// <param name="value">值</param>
 /// <param name="digit">保留小数位数</param>
 /// <param name="font">字体</param>
 /// <param name="fontColor">文字颜色</param>
 /// <param name="zeroAsEmpty">0是否为空</param>
 /// <param name="x">横坐标</param>
 /// <param name="y">纵坐标</param>
 /// <returns>绘制的横坐标</returns>
 public static int DrawUnderLineNum(CPaint paint, double value, int digit, FONT font, long fontColor, bool zeroAsEmpty, int x, int y)
 {
     if (zeroAsEmpty && value == 0)
     {
         String text = "-";
         SIZE   size = paint.TextSize(text, font);
         CDraw.DrawText(paint, text, fontColor, font, x, y);
         return(size.cx);
     }
     else
     {
         String[] nbs = CStr.GetValueByDigit(value, digit).Split(new String[] { "." }, StringSplitOptions.RemoveEmptyEntries);
         if (nbs.Length == 1)
         {
             SIZE size = paint.TextSize(nbs[0], font);
             CDraw.DrawText(paint, nbs[0], fontColor, font, x, y);
             return(size.cx);
         }
         else
         {
             SIZE decimalSize = paint.TextSize(nbs[0], font);
             SIZE size        = paint.TextSize(nbs[1], font);
             CDraw.DrawText(paint, nbs[0], fontColor, font, x, y);
             CDraw.DrawText(paint, nbs[1], fontColor, font, x
                            + decimalSize.cx + 1, y);
             paint.DrawLine(fontColor, 1, 0, x
                            + decimalSize.cx + 1, y + decimalSize.cy,
                            x + decimalSize.cx + size.cx, y + decimalSize.cy);
             return(decimalSize.cx + size.cx);
         }
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// 重绘边线方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaintBorder(CPaint paint, RECT clipRect)
        {
            int  width = Width, height = Height;
            RECT drawRect = new RECT(0, 0, width, height);

            paint.DrawRoundRect(COLOR.CONTROLBORDER, 1, 0, drawRect, 6);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 重绘背景方法
        /// </summary>
        /// <param name="paint">绘图区域</param>
        /// <param name="clipRect">裁剪对象</param>
        public override void OnPaintBackground(CPaint paint, RECT clipRect)
        {
            int  width = Width, height = Height;
            RECT drawRect = new RECT(0, 0, width, height);

            paint.FillGradientRect(CDraw.PCOLORS_BACKCOLOR, CDraw.PCOLORS_BACKCOLOR2, drawRect, 0, 90);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 重绘前景方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaintBackground(CPaint paint, RECT clipRect)
        {
            int  width     = Width;
            int  height    = Height;
            RECT rect      = new RECT(0, 0, width, height);
            long backColor = CDraw.PCOLORS_WINDOWBACKCOLOR;
            long foreColor = CDraw.PCOLORS_WINDOWFORECOLOR;

            if (paint.SupportTransparent())
            {
                backColor = CDraw.PCOLORS_WINDOWBACKCOLOR2;
            }
            int  captionHeight = CaptionHeight;
            RECT contentRect   = rect;

            contentRect.top    += captionHeight;
            contentRect.bottom -= 6;
            contentRect.left   += 6;
            contentRect.right  -= 6;
            paint.BeginPath();
            paint.AddRect(contentRect);
            paint.ExcludeClipPath();
            paint.ClosePath();
            paint.FillRoundRect(backColor, rect, 6);
            paint.SetClip(clipRect);
            if (contentRect.right - contentRect.left > 0 && contentRect.bottom - contentRect.top > 0)
            {
                contentRect.top    -= 1;
                contentRect.left   -= 1;
                contentRect.right  += 1;
                contentRect.bottom += 1;
                paint.FillRect(CDraw.PCOLORS_WINDOWCONTENTBACKCOLOR, contentRect);
            }
            CDraw.DrawText(paint, Text, foreColor, Font, 5, 3);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 重绘方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        public void OnPaint(CPaint paint)
        {
            RECT rect   = Bounds;
            int  width  = rect.right - rect.left;
            int  height = rect.bottom - rect.top;

            if ((rect.left >= 0 || rect.top >= 0 || rect.right >= 0 || rect.bottom >= 0) && width > 0 && height > 0)
            {
                //绘制背景
                paint.FillRect(BackColor, rect);
                String text   = CStr.GetValueByDigit(Value, m_gannSquare.Digit);
                String suffix = m_gannSquare.Suffix;
                if (suffix != null && suffix.Length > 0)
                {
                    text += suffix;
                }
                SIZE textSize = paint.TextSize(text, m_gannSquare.CellFont);
                //画文字
                POINT tPoint = new POINT(rect.left + (width - textSize.cx) / 2,
                                         rect.top + (height - textSize.cy) / 2);
                RECT tRect = new RECT(tPoint.x, tPoint.y, tPoint.x + textSize.cx, tPoint.y + textSize.cy);
                paint.DrawText(text, ForeColor, m_gannSquare.CellFont, tRect);
                //绘制边线
                paint.DrawLine(COLOR.ARGB(167, 170, 178), 0, 0, rect.left, rect.top, rect.right, rect.top);
                paint.DrawLine(COLOR.ARGB(167, 170, 178), 0, 0,
                               rect.right, rect.top, rect.right, rect.bottom);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 重绘前景方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaintBackground(CPaint paint, RECT clipRect)
        {
            int  width         = Width;
            int  height        = Height;
            RECT rect          = new RECT(0, 0, width, height - 1);
            long foreColor     = CDraw.PCOLORS_WINDOWFORECOLOR;
            int  captionHeight = CaptionHeight;
            RECT contentRect   = rect;

            contentRect.top    += captionHeight;
            contentRect.bottom -= 6;
            contentRect.left   += 6;
            contentRect.right  -= 6;
            paint.BeginPath();
            paint.AddRect(contentRect);
            paint.ExcludeClipPath();
            paint.ClosePath();
            paint.FillGradientRect(CDraw.PCOLORS_BACKCOLOR2, CDraw.PCOLORS_BACKCOLOR2, rect, 6, 0);
            paint.SetClip(clipRect);
            paint.FillGradientRect(CDraw.PCOLORS_BACKCOLOR, CDraw.PCOLORS_BACKCOLOR2, new RECT(0, 0, width, captionHeight), 6, 90);
            paint.DrawRoundRect(COLOR.CONTROLBORDER, 1, 0, rect, 6);
            if (contentRect.right - contentRect.left > 0 && contentRect.bottom - contentRect.top > 0)
            {
                contentRect.top    -= 1;
                contentRect.left   -= 1;
                contentRect.right  += 1;
                contentRect.bottom += 1;
                paint.FillGradientRect(CDraw.PCOLORS_BACKCOLOR2, CDraw.PCOLORS_BACKCOLOR2, contentRect, 6, 0);
                //paint.FillRect(CDraw.PCOLORS_WINDOWCONTENTBACKCOLOR, contentRect);
            }
            paint.DrawLine(COLOR.CONTROLBORDER, 1, 0, 0, captionHeight - 1, width, captionHeight - 1);
            CDraw.DrawText(paint, Text, foreColor, Font, 10, 4);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 重绘方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaint(CPaint paint, RECT clipRect)
        {
            int width  = Width;
            int height = Height;

            if (width > 0 && height > 0)
            {
                //绘制背景
                RECT drawRect = new RECT(0, 0, width, height);
                paint.FillRect(GetPaintingBackColor(), clipRect);
                paint.DrawImage("file='Logo.png'", new RECT(30, 50, 300, 150));
                if (m_showRecord)
                {
                    double num        = Convert.ToDouble(m_stopWatch.ElapsedMilliseconds);
                    String highRecord = "HIGH " + m_high.ToString("0.000");
                    FONT   font       = Font;
                    SIZE   tSize      = paint.TextSize(highRecord, font);
                    paint.DrawText(highRecord, ForeColor, font, new RECT(Width / 2 - tSize.cx / 2, 5, Width, 20));
                    String nowRecord = "TIME" + ((num / 1000.0)).ToString("0.000");
                    paint.DrawText(nowRecord, ForeColor, font, new RECT(0, 5, 100, 20));
                }
                m_plane.OnPaintBackground(paint);
                for (int i = 0; i < m_bullets.Count; i++)
                {
                    Bullet bullet = m_bullets[i];
                    bullet.OnPaintBackground(paint);
                }
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 绘制文字
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="text">文字</param>
        /// <param name="dwPenColor">颜色</param>
        /// <param name="font">字体</param>
        /// <param name="x">横坐标</param>
        /// <param name="y">纵坐标</param>
        public static void DrawText(CPaint paint, String text, long dwPenColor, FONT font, int x, int y)
        {
            SIZE tSize = paint.TextSize(text, font);
            RECT tRect = new RECT(x, y, x + tSize.cx, y + tSize.cy);

            paint.DrawText(text, dwPenColor, font, tRect);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 重绘背景方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        public void OnPaintBackground(CPaint paint)
        {
            RECT drawRect = new RECT(m_location.x - 6, m_location.y - 6, m_location.x + 6, m_location.y + 6);

            //paint.DrawGradientEllipse(m_backColor, COLOR.RatioColor(paint, m_backColor, 1.1), drawRect, 90);
            paint.DrawRoundRect(m_backColor, 1, 0, drawRect, 5);
            drawRect.left   -= m_tick;
            drawRect.top    -= m_tick;
            drawRect.right  += m_tick;
            drawRect.bottom += m_tick;
            paint.FillEllipse(COLOR.ARGB(50, 255, 255, 0), drawRect);
            if (m_tick > 10)
            {
                m_tick = 0;
            }
            if (m_tick2 % 1 == 0)
            {
                m_tick++;
            }
            m_tick2++;
            if (m_tick2 > 1000)
            {
                m_tick2 = 0;
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 绘制背景
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaintBackground(CPaint paint, RECT clipRect)
        {
            int  width = Width - 1, height = Height - 1;
            RECT drawRect = new RECT(0, 0, width, height);

            paint.FillRect(COLOR.ARGB(0, 0, 0), drawRect);
            int  outSize = 40;
            int  oX = width / 2, oY = height / 2, r = (width - outSize * 2) / 2;
            long innerBorderColor = COLOR.ARGB(100, 100, 100);

            int[] angles = new int[] { 240, 180, 120, 60, 0, -60 };
            int[] rs     = new int[] { r, r * 2 / 3, r / 3 };
            for (int i = 0; i < 3; i++)
            {
                POINT[] drawPoints = new POINT[6];
                for (int j = 0; j < 6; j++)
                {
                    drawPoints[j] = GetCyclePoint(oX, oY, rs[i], angles[j]);
                }
                paint.DrawPolygon(innerBorderColor, 1, 0, drawPoints);
            }
            FONT pFont = new FONT("微软雅黑", 16, false, false, false);

            POINT[] points     = GetTitlePoints();
            int     pointsSize = points.Length;

            String[] strs   = new String[] { "业务", "情商", "学识", "智商", "管理", "技术" };
            int[]    values = new int[6];
            if (m_dimension != null)
            {
                values = new int[] { m_dimension.m_business, m_dimension.m_EQ, m_dimension.m_knowledge,
                                     m_dimension.m_IQ, m_dimension.m_lead, m_dimension.m_technology };
            }
            POINT [] scopePoints = GetScopePoints();
            for (int i = 0; i < pointsSize; i++)
            {
                int   bSize  = 5;
                POINT bPoint = points[i];
                RECT  bRect  = new RECT(bPoint.x - bSize, bPoint.y - bSize, bPoint.x + bSize, bPoint.y + bSize);
                SIZE  pSize  = paint.TextSize(strs[i], pFont);
                if (i == 0 || i == 5)
                {
                    bPoint.y -= 20;
                }
                CDraw.DrawText(paint, strs[i], m_sysColors[i], pFont, bPoint.x - pSize.cx / 2, bPoint.y - pSize.cy / 2);
                int   iSize = 5;
                POINT cp    = GetCyclePoint(oX, oY, r, angles[i]);
                paint.DrawLine(innerBorderColor, 1, 0, oX, oY, cp.x, cp.y);
                paint.FillEllipse(m_sysColors[i], new RECT(cp.x - iSize, cp.y - iSize, cp.x + iSize, cp.y + iSize));
                String text  = String.Format("({0})", CStr.ConvertIntToStr(values[i]));
                SIZE   sSize = paint.TextSize(text, pFont);
                CDraw.DrawText(paint, text, m_sysColors[i], pFont, bPoint.x - sSize.cx / 2, bPoint.y + sSize.cy / 2);
            }
            if (m_dimension != null)
            {
                paint.FillGradientPolygon(COLOR.ARGB(200, 50, 105, 217), COLOR.ARGB(200, 50, 105, 217), scopePoints, 90);
                paint.DrawPolygon(COLOR.ARGB(100, 255, 255, 255), 1, 0, scopePoints);
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 绘制前景方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaintForeground(CPaint paint, RECT clipRect)
        {
            RECT bounds = Bounds;
            int  width  = bounds.right - bounds.left;
            int  height = bounds.bottom - bounds.top;

            if (width > 0 && height > 0)
            {
                if (m_ssLatestData != null && m_szLatestData != null && m_cyLatestData != null)
                {
                    long titleColor = CDraw.PCOLORS_FORECOLOR2;
                    FONT font       = new FONT("SimSun", 16, false, false, false);
                    FONT indexFont  = new FONT("Arial", 14, true, false, false);
                    long grayColor  = CDraw.PCOLORS_FORECOLOR4;
                    //上证指数
                    long indexColor = CDraw.GetPriceColor(m_ssLatestData.m_close, m_ssLatestData.m_lastClose);
                    int  left       = 1;
                    CDraw.DrawText(paint, "上证", titleColor, font, left, 3);
                    left += 40;
                    paint.DrawLine(grayColor, 1, 0, left, 0, left, height);
                    String amount     = (m_ssLatestData.m_amount / 100000000).ToString("0.0") + "亿";
                    SIZE   amountSize = paint.TextSize(amount, indexFont);
                    CDraw.DrawText(paint, amount, titleColor, indexFont, width / 3 - amountSize.cx, 3);
                    left += (width / 3 - 40 - amountSize.cx) / 4;
                    int length = CDraw.DrawUnderLineNum(paint, m_ssLatestData.m_close, 2, indexFont, indexColor, false, left, 3);
                    left  += length + (width / 3 - 40 - amountSize.cx) / 4;
                    length = CDraw.DrawUnderLineNum(paint, m_ssLatestData.m_close - m_ssLatestData.m_lastClose, 2, indexFont, indexColor, false, left, 3);
                    //深证指数
                    left = width / 3;
                    paint.DrawLine(grayColor, 1, 0, left, 0, left, height);
                    indexColor = CDraw.GetPriceColor(m_szLatestData.m_close, m_szLatestData.m_lastClose);
                    CDraw.DrawText(paint, "深证", titleColor, font, left, 3);
                    left += 40;
                    paint.DrawLine(grayColor, 1, 0, left, 0, left, height);
                    amount     = (m_szLatestData.m_amount / 100000000).ToString("0.0") + "亿";
                    amountSize = paint.TextSize(amount, indexFont);
                    CDraw.DrawText(paint, amount, titleColor, indexFont, width * 2 / 3 - amountSize.cx, 3);
                    left  += (width / 3 - 40 - amountSize.cx) / 4;
                    length = CDraw.DrawUnderLineNum(paint, m_szLatestData.m_close, 2, indexFont, indexColor, false, left, 3);
                    left  += length + (width / 3 - 40 - amountSize.cx) / 4;
                    length = CDraw.DrawUnderLineNum(paint, m_szLatestData.m_close - m_szLatestData.m_lastClose, 2, indexFont, indexColor, false, left, 3);
                    //创业指数
                    left = width * 2 / 3;
                    paint.DrawLine(grayColor, 1, 0, left, 0, left, height);
                    indexColor = CDraw.GetPriceColor(m_cyLatestData.m_close, m_cyLatestData.m_lastClose);
                    CDraw.DrawText(paint, "创业", titleColor, font, left, 3);
                    left += 40;
                    paint.DrawLine(grayColor, 1, 0, left, 0, left, height);
                    amount     = (m_cyLatestData.m_amount / 100000000).ToString("0.0") + "亿";
                    amountSize = paint.TextSize(amount, indexFont);
                    CDraw.DrawText(paint, amount, titleColor, indexFont, width - amountSize.cx, 3);
                    left  += (width / 3 - 40 - amountSize.cx) / 4;
                    length = CDraw.DrawUnderLineNum(paint, m_cyLatestData.m_close, 2, indexFont, indexColor, false, left, 3);
                    left  += (width / 3 - 40 - amountSize.cx) / 4 + length;
                    length = CDraw.DrawUnderLineNum(paint, m_cyLatestData.m_close - m_cyLatestData.m_lastClose, 2, indexFont, indexColor, false, left, 3);
                    paint.DrawRect(grayColor, 1, 0, new RECT(0, 0, width - 1, height - 1));
                }
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 重绘菜单布局
        /// </summary>
        /// <param name="sender">调用对象</param>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        private void PaintLayoutDiv(object sender, CPaint paint, OwLib.RECT clipRect)
        {
            ControlA control = sender as ControlA;
            int      width = control.Width, height = control.Height;

            OwLib.RECT drawRect = new OwLib.RECT(0, 0, width, height);
            paint.FillGradientRect(CDraw.PCOLORS_BACKCOLOR, CDraw.PCOLORS_BACKCOLOR2, drawRect, 0, 90);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 重绘方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaint(CPaint paint, RECT clipRect)
        {
            int width  = Width;
            int height = Height;

            if (width > 0 && height > 0)
            {
                //绘制背景
                RECT drawRect = new RECT(0, 0, width, height);
                paint.FillRect(GetPaintingBackColor(), clipRect);
                for (int i = 0; i < m_bullets.Count; i++)
                {
                    Bullet bullet = m_bullets[i];
                    bullet.OnPaintBackground(paint);
                }
                String text   = String.Format("{0}/{1}", m_score, m_total);
                FONT   font   = Font;
                SIZE   tSize  = paint.TextSize(text, font);
                POINT  tPoint = new POINT(width / 2 - tSize.cx / 2, 10);
                RECT   tRect  = new RECT(tPoint.x, tPoint.y, tPoint.x + tSize.cx, tSize.cy);
                //paint.DrawText(text, ForeColor, font, tRect);
                int pointsSize = m_points.Count;
                for (int i = 0; i < pointsSize; i++)
                {
                    POINT point = m_points[i];
                    RECT  pRect = new RECT(point.x - 10, point.y - 10, point.x + 10, point.y + 10);
                    paint.FillGradientEllipse(COLOR.ARGB(50, 0, 0, 0), COLOR.ARGB(50, 30, 30, 30), pRect, 90);
                    paint.DrawEllipse(COLOR.ARGB(50, 100, 100, 100), 1, 0, pRect);
                }
                String title  = "随机选拔";
                FONT   tiFont = new FONT("微软雅黑", 30, true, false, false);
                SIZE   tiSize = paint.TextSize(title, tiFont);
                RECT   tiRect = new RECT();
                tiRect.left   = (width - tiSize.cx) / 2;
                tiRect.top    = height - 120;
                tiRect.right  = tiRect.left + tiSize.cx;
                tiRect.bottom = tiRect.top + tiSize.cy;
                paint.DrawText(title, COLOR.ARGB(255, 0, 0), tiFont, tiRect);
                int membersSize = m_members.Count;
                if (membersSize > 0)
                {
                    int avgWidth = width / membersSize, mLeft = 0;
                    for (int i = 0; i < membersSize; i++)
                    {
                        FONT   mFont  = new FONT("微软雅黑", 35, true, false, false);
                        String member = m_members[i];
                        SIZE   mSize  = paint.TextSize(member, mFont);
                        RECT   mRect  = new RECT();
                        mRect.left   = mLeft + (avgWidth - mSize.cx) / 2;
                        mRect.top    = height - 80;
                        mRect.right  = mRect.left + mSize.cx;
                        mRect.bottom = mRect.top + mSize.cy;
                        paint.DrawText(member, m_sysColors[m_random.Next(0, m_sysColors.Length)], mFont, mRect);
                        mLeft += avgWidth;
                    }
                }
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 绘制背景
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaintBackground(CPaint paint, RECT clipRect)
        {
            int   width = Width, height = Height;
            float xRate    = (float)width / 200;
            float yRate    = (float)height / 200;
            RECT  drawRect = new RECT(0, 0, width - 1, height - 1);

            if (m_isEllipse)
            {
                paint.FillEllipse(GetPaintingBackColor(), drawRect);
            }
            else
            {
                paint.FillRect(GetPaintingBackColor(), drawRect);
            }
            long  foreColor = GetPaintingForeColor();
            float lineWidth = 10 * xRate;

            if (m_style == WindowButtonStyle.Close)
            {
                paint.SetLineCap(2, 2);
                paint.DrawLine(foreColor, lineWidth, 0, (int)(135 * xRate), (int)(70 * yRate), (int)(70 * xRate), (int)(135 * yRate));
                paint.DrawLine(foreColor, lineWidth, 0, (int)(70 * xRate), (int)(70 * yRate), (int)(135 * xRate), (int)(135 * yRate));
            }
            else if (m_style == WindowButtonStyle.Max)
            {
                paint.SetLineCap(2, 2);
                paint.DrawLine(foreColor, lineWidth, 0, (int)(80 * xRate), (int)(80 * yRate), (int)(60 * xRate), (int)(60 * yRate));
                paint.DrawLine(foreColor, lineWidth, 0, (int)(125 * xRate), (int)(145 * yRate), (int)(145 * xRate), (int)(145 * yRate));
                paint.DrawLine(foreColor, lineWidth, 0, (int)(145 * xRate), (int)(125 * yRate), (int)(145 * xRate), (int)(145 * yRate));
                paint.DrawLine(foreColor, lineWidth, 0, (int)(125 * xRate), (int)(125 * yRate), (int)(145 * xRate), (int)(145 * yRate));
                paint.DrawLine(foreColor, lineWidth, 0, (int)(60 * xRate), (int)(80 * yRate), (int)(60 * xRate), (int)(60 * yRate));
                paint.DrawLine(foreColor, lineWidth, 0, (int)(80 * xRate), (int)(60 * yRate), (int)(60 * xRate), (int)(60 * yRate));
                paint.DrawLine(foreColor, lineWidth, 0, (int)(125 * xRate), (int)(80 * yRate), (int)(145 * xRate), (int)(60 * yRate));
                paint.DrawLine(foreColor, lineWidth, 0, (int)(145 * xRate), (int)(80 * yRate), (int)(145 * xRate), (int)(60 * yRate));
                paint.DrawLine(foreColor, lineWidth, 0, (int)(125 * xRate), (int)(60 * yRate), (int)(145 * xRate), (int)(60 * yRate));
                paint.DrawLine(foreColor, lineWidth, 0, (int)(80 * xRate), (int)(125 * yRate), (int)(60 * xRate), (int)(145 * yRate));
                paint.DrawLine(foreColor, lineWidth, 0, (int)(60 * xRate), (int)(125 * yRate), (int)(60 * xRate), (int)(145 * yRate));
                paint.DrawLine(foreColor, lineWidth, 0, (int)(80 * xRate), (int)(145 * yRate), (int)(60 * xRate), (int)(145 * yRate));
            }
            else if (m_style == WindowButtonStyle.Min)
            {
                paint.SetLineCap(2, 2);
                paint.DrawLine(foreColor, lineWidth, (int)(0 * xRate), (int)(60 * yRate), (int)(105 * xRate), (int)(135 * xRate), (int)(105 * yRate));
            }
            else if (m_style == WindowButtonStyle.Restore)
            {
                paint.SetLineCap(2, 2);
                paint.DrawLine(foreColor, lineWidth, (int)(0 * xRate), (int)(90 * yRate), (int)(90 * xRate), (int)(70 * xRate), (int)(70 * yRate));
                paint.DrawLine(foreColor, lineWidth, (int)(0 * xRate), (int)(90 * yRate), (int)(90 * xRate), (int)(70 * xRate), (int)(90 * yRate));
                paint.DrawLine(foreColor, lineWidth, (int)(0 * xRate), (int)(90 * yRate), (int)(90 * xRate), (int)(90 * xRate), (int)(70 * yRate));
                paint.DrawLine(foreColor, lineWidth, (int)(0 * xRate), (int)(115 * yRate), (int)(115 * xRate), (int)(135 * xRate), (int)(135 * yRate));
                paint.DrawLine(foreColor, lineWidth, (int)(0 * xRate), (int)(115 * yRate), (int)(115 * xRate), (int)(135 * xRate), (int)(115 * yRate));
                paint.DrawLine(foreColor, lineWidth, (int)(0 * xRate), (int)(115 * yRate), (int)(115 * xRate), (int)(115 * xRate), (int)(135 * yRate));
            }
            paint.SetLineCap(0, 0);
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 重绘方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="rect">矩形</param>
        /// <param name="clipRect">裁剪矩形</param>
        /// <param name="isAlternate">是否交替行</param>
        public override void OnPaint(CPaint paint, RECT rect, RECT clipRect, bool isAlternate)
        {
            int clipW = clipRect.right - clipRect.left;
            int clipH = clipRect.bottom - clipRect.top;

            if (clipW > 0 && clipH > 0)
            {
                GridA      grid   = Grid;
                GridRow    row    = Row;
                GridColumn column = Column;
                if (grid != null && row != null && column != null)
                {
                    //判断选中
                    String         text             = Text;
                    bool           selected         = false;
                    List <GridRow> selectedRows     = grid.SelectedRows;
                    int            selectedRowsSize = selectedRows.Count;
                    for (int i = 0; i < selectedRowsSize; i++)
                    {
                        if (selectedRows[i] == row)
                        {
                            selected = true;
                            break;
                        }
                    }
                    //获取颜色
                    FONT          font      = null;
                    long          foreColor = COLOR.EMPTY;
                    GridCellStyle style     = Style;
                    if (style != null)
                    {
                        if (style.Font != null)
                        {
                            font = style.Font;
                        }
                        foreColor = style.ForeColor;
                    }
                    SecurityFilterInfo info = (row as SecurityFilterResultRow).Info;
                    if (info.GetValue("FILTER") != 1)
                    {
                        foreColor = CDraw.PCOLORS_FORECOLOR8;
                    }
                    SIZE  tSize  = paint.TextSize(text, font);
                    POINT tPoint = new POINT(rect.left + 1, rect.top + clipH / 2 - tSize.cy / 2);
                    if (column.Name == "colCode")
                    {
                        tPoint.x = rect.right - tSize.cx;
                    }
                    RECT tRect = new RECT(tPoint.x, tPoint.y, tPoint.x + tSize.cx, tPoint.y + tSize.cy);
                    paint.DrawText(text, foreColor, font, tRect);
                    if (selected)
                    {
                        paint.DrawLine(CDraw.PCOLORS_LINECOLOR, 2, 0, rect.left, rect.bottom - 1, rect.right, rect.bottom - 1);
                    }
                }
            }
        }
Ejemplo n.º 20
0
        /// <summary>
        /// 重绘层
        /// </summary>
        /// <param name="sender">调用者</param>
        /// <param name="paint">绘图对象</param>
        /// <param name="clicpRect">裁剪区域</param>
        private void PaintDiv(Object sender, CPaint paint, RECT clicpRect)
        {
            DivA div = sender as DivA;
            int  width = div.Width, height = div.Height;
            RECT drawRect = new RECT(0, 0, width, height);

            if (m_mode == 5)
            {
                paint.FillGradientRect(COLOR.ARGB(200, 255, 40, 24), COLOR.ARGB(200, 255, 255, 40), drawRect, 0, m_tick % 360);
            }
            else
            {
                paint.FillGradientRect(COLOR.ARGB(200, 90, 120, 24), COLOR.ARGB(200, 122, 156, 40), drawRect, 0, 0);
            }
            RECT bounds        = m_lblTime.Bounds;
            RECT fullBloodRect = new RECT(bounds.left, bounds.bottom, bounds.left + 400, bounds.bottom + 15);

            paint.FillRect(COLOR.ARGB(255, 0, 0), fullBloodRect);
            int  bloodWidth = (int)(m_currentTick / m_totalTick * 400);
            RECT bloodRect  = new RECT(bounds.left, bounds.bottom, bounds.left + bloodWidth, bounds.bottom + 15);

            if (bloodWidth < 40)
            {
                paint.FillRect(COLOR.ARGB(255, 150, 0), bloodRect);
            }
            else if (bloodWidth < 120)
            {
                paint.FillRect(COLOR.ARGB(255, 200, 0), bloodRect);
            }
            else
            {
                paint.FillRect(COLOR.ARGB(255, 255, 0), bloodRect);
            }
            if (m_currentQuestion != null && m_currentQuestion.m_type == "极限")
            {
                String[] strs   = m_txtAnswer.Text.Split(new String[] { "\r" }, StringSplitOptions.RemoveEmptyEntries);
                int      cCount = 0;
                foreach (String str in strs)
                {
                    if (str == "for(int i = 0; i < 100; i++)")
                    {
                        cCount++;
                    }
                }
                String strLine = cCount.ToString();
                FONT   tFont   = new FONT("微软雅黑", 100, true, false, true);
                SIZE   tSize   = paint.TextSize(strLine, tFont);
                RECT   tRect   = new RECT();
                tRect.left   = (width - tSize.cx) / 2;
                tRect.top    = (height - tSize.cy) / 2;
                tRect.right  = tRect.left + tSize.cx;
                tRect.bottom = tRect.top + tSize.cy;
                paint.DrawText(strLine, COLOR.ARGB(200, 255, 255, 255), tFont, tRect);
            }
        }
Ejemplo n.º 21
0
        /// <summary>
        /// 重绘背景方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaintBackground(CPaint paint, RECT clipRect)
        {
            int width  = Width;
            int height = Height;

            if (width > 0 && height > 0)
            {
                //绘制背景
                RECT drawRect = new RECT(0, 0, width, height);
                //paint.DrawGradientRect(COLOR.ARGB(200, 90, 120, 24), COLOR.ARGB(200, 122, 156, 40), drawRect, 0, 90);
                paint.DrawRoundRect(COLOR.ARGB(200, 90, 120, 24), 1, 0, drawRect, 5);
                if (m_play.GameState != GameState.Begin)
                {
                    //绘制分数
                    FONT   font     = Font;
                    String strScore = m_eatCount.ToString();
                    SIZE   tSize    = paint.TextSize(strScore, font);
                    //修正透明度
                    if (m_play.GameState == GameState.Playing)
                    {
                        //减少
                        if (m_alphaDirection == 0)
                        {
                            m_alpha -= 5;
                        }
                        //增加
                        else if (m_alphaDirection == 1)
                        {
                            m_alpha += 5;
                        }
                        //改变变动方向
                        if (m_alpha > 50)
                        {
                            m_alphaDirection = 0;
                            m_alpha          = 50;
                        }
                        else if (m_alpha < 20)
                        {
                            m_alphaDirection = 1;
                            m_alpha          = 20;
                        }
                    }
                    else
                    {
                        m_alpha = 50;
                    }
                    RECT tRect = new RECT();
                    tRect.left   = drawRect.right / 2 - tSize.cx / 2;
                    tRect.top    = drawRect.bottom / 2 - tSize.cy / 2;
                    tRect.right  = tRect.left + tSize.cx;
                    tRect.bottom = tRect.top + tSize.cy;
                    paint.DrawText(strScore, COLOR.ARGB(m_alpha * 3, 255, 255, 255), font, tRect);
                }
            }
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 重绘前景方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaintForeground(CPaint paint, RECT clipRect)
        {
            int  width  = Width;
            int  height = Height;
            FONT font   = new FONT("微软雅黑", 14, true, false, false);

            if (m_tick != 0)
            {
                font.m_fontSize += 2;
            }
            long   foreColor = GetPaintingForeColor();
            String backImage = GetPaintingBackImage();
            int    border    = m_tick;

            if (border > 10)
            {
                border = 10;
            }
            int  imgWidth  = 88 - (10 - border);
            int  imgHeight = 88 - (10 - border);
            int  gap       = 15;
            RECT imageRect = new RECT((width - imgWidth) / 2, (height - imgHeight) / 2 - gap, (width + imgWidth) / 2, (height + imgHeight) / 2 - gap);

            if (backImage != null && backImage.Length > 0)
            {
                if (m_tick != 0)
                {
                    paint.SetOpacity((float)(0.5 + border * 0.05f));
                }
                paint.DrawImage(backImage, imageRect);
                paint.SetOpacity(1);
            }
            if (m_text != null && m_name.Length > 0)
            {
                SIZE tSize = paint.TextSize(m_text, font);
                RECT tRect = new RECT();
                tRect.left   = (width - tSize.cx) / 2;
                tRect.top    = imageRect.bottom + gap;
                tRect.right  = tRect.left + tSize.cx;
                tRect.bottom = tRect.top + tSize.cy;
                paint.DrawText(m_text, foreColor, font, tRect);
            }
            if (m_direction == 1)
            {
                int pointsSize = m_points.Count;
                for (int i = 0; i < pointsSize; i++)
                {
                    POINT point = m_points[i];
                    RECT  pRect = new RECT(point.x - 10, point.y - 10, point.x + 10, point.y + 10);
                    paint.FillGradientEllipse(COLOR.ARGB(50, 255, 255, 255), COLOR.ARGB(50, 220, 220, 220), pRect, 90);
                    paint.DrawEllipse(COLOR.ARGB(50, 100, 100, 100), 1, 0, pRect);
                }
            }
        }
Ejemplo n.º 23
0
        /// <summary>
        /// 绘图方法
        /// </summary>
        /// <param name="sender">调用者</param>
        /// <param name="paint">绘图</param>
        /// <param name="clipRect">裁剪区域</param>
        private void PaintDiv(object sender, CPaint paint, RECT clipRect)
        {
            List <DialogInfo> dialogs      = DataCenter.DialogService.m_dialogs;
            int dialogsSize                = dialogs.Count;
            Dictionary <String, int> names = new Dictionary <String, int>();

            for (int i = 0; i < dialogsSize; i++)
            {
                DialogInfo dialog = dialogs[i];
                if (names.ContainsKey(dialog.m_name))
                {
                    names[dialog.m_name] = names[dialog.m_name] + 1;
                }
                else
                {
                    names[dialog.m_name] = 1;
                }
            }
            List <DialogData> datas = new List <DialogData>();

            foreach (String key in names.Keys)
            {
                DialogData data = new DialogData();
                data.m_name  = key;
                data.m_times = names[key];
                datas.Add(data);
            }
            datas.Sort(new DialogDataCompare());
            int width = m_divDialogs.Width, height = m_divDialogs.Height;
            int datasSize = datas.Count;

            if (datasSize > 0)
            {
                int    paddingLeft = 50, paddingRight = 50, paddingTop = 20, paddingBottom = 20;
                int    top   = paddingTop;
                int    pSize = (height - paddingTop - paddingBottom) / datasSize;
                double max   = 0;
                for (int i = 0; i < datasSize; i++)
                {
                    DialogData data = datas[i];
                    if (i == 0)
                    {
                        max = data.m_times;
                    }
                    int wSize = (int)((width - paddingLeft - paddingRight) * data.m_times / max);
                    CDraw.DrawText(paint, data.m_name, COLOR.ARGB(0, 0, 0), m_divDialogs.Font, 5, top);
                    paint.FillGradientRect(m_sysColors[i % m_sysColors.Length], m_sysColors[(i + 1) % m_sysColors.Length], new RECT(paddingLeft, top + 2, paddingLeft + wSize, top + 12), 2, 0);
                    FONT font = new FONT("微软雅黑", 14, false, false, false);
                    CDraw.DrawText(paint, data.m_times.ToString(), COLOR.ARGB(0, 0, 0), font, paddingLeft + wSize, top);
                    top += pSize;
                }
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// 重绘背景方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaintBackground(CPaint paint, RECT clipRect)
        {
            int width  = Width;
            int height = Height;

            if (width > 0 && height > 0)
            {
                //绘制关节
                RECT drawRect          = new RECT(0, 0, width, width);
                long paintingBackColor = GetPaintingBackColor();
                //paint.DrawGradientEllipse(paintingBackColor, COLOR.RatioColor(paint, paintingBackColor, 1.1), drawRect, 90);
                paint.DrawRoundRect(m_backColor, 1, 0, drawRect, 5);
                if (m_isHeader)
                {
                    POINT eyeLeft  = new POINT();
                    POINT eyeRight = new POINT();
                    //绘制眼睛
                    switch (m_direction)
                    {
                    //向下
                    case SnakeDirection.Down:
                        eyeLeft  = new POINT(width / 3, height * 2 / 3);
                        eyeRight = new POINT(width * 2 / 3, height * 2 / 3);
                        break;

                    //向左
                    case SnakeDirection.Left:
                        eyeLeft  = new POINT(width / 3, height / 3);
                        eyeRight = new POINT(width / 3, height * 2 / 3);
                        break;

                    //向右
                    case SnakeDirection.Right:
                        eyeLeft  = new POINT(width * 2 / 3, height * 2 / 3);
                        eyeRight = new POINT(width * 2 / 3, height / 3);
                        break;

                    //向上
                    case SnakeDirection.Up:
                        eyeLeft  = new POINT(width / 3, height / 3);
                        eyeRight = new POINT(width * 2 / 3, height / 3);
                        break;
                    }
                    //画左眼
                    RECT lRect = new RECT(eyeLeft.x - 2, eyeLeft.y - 2, eyeLeft.x + 2, eyeLeft.y + 2);
                    paint.FillEllipse(COLOR.ARGB(255, 255, 255), lRect);
                    //画右眼
                    RECT rRect = new RECT(eyeRight.x - 2, eyeRight.y - 2, eyeRight.x + 2, eyeRight.y + 2);
                    paint.FillEllipse(COLOR.ARGB(255, 255, 255), rRect);
                }
            }
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 重绘背景方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaintBackground(CPaint paint, RECT clipRect)
        {
            int width  = Width;
            int height = Height;

            if (width > 0 && height > 0)
            {
                //绘制食物
                RECT drawRect          = new RECT(0, 0, width - 1, height - 1);
                long paintingBackColor = GetPaintingBackColor();
                paint.DrawGradientEllipse(paintingBackColor, COLOR.RatioColor(paint, paintingBackColor, 0.9), drawRect, 90);
            }
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 绘制边线方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaintBorder(CPaint paint, RECT clipRect)
        {
            int  width = Width, height = Height;
            RECT drawRect = new RECT(0, 0, width, height);

            if (m_isEllipse)
            {
                paint.DrawEllipse(GetPaintingBorderColor(), 1, 0, drawRect);
            }
            else
            {
                paint.DrawRect(GetPaintingBorderColor(), 1, 0, drawRect);
            }
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 绘制边线方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaintBorder(CPaint paint, RECT clipRect)
        {
            int width = Width, height = Height;
            int border = m_tick;

            if (border > 10)
            {
                border = 10;
            }
            RECT   drawRect     = new RECT(10 - border, 10 - border, width - (10 - border), height - (10 - border));
            String text         = Text;
            int    cornerRadius = 10;

            paint.DrawRoundRect(GetPaintingBorderColor(), IsDragging ? 2 : 1, IsDragging ? 1 : 0, drawRect, cornerRadius);
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 重绘背景方法
        /// </summary>
        /// <param name="paint">绘图对象</param>
        /// <param name="clipRect">裁剪区域</param>
        public override void OnPaintBackground(CPaint paint, RECT clipRect)
        {
            int  width = Width - 10, height = Height - 10;
            RECT drawRect   = new RECT(0, 0, width, height);
            RECT shadowRect = new RECT(5, 5, width + 2, height + 5);

            paint.FillEllipse(COLOR.ARGB(100, 0, 0, 0), shadowRect);
            if (m_mainFrame != null && m_mainFrame.Mode == 5)
            {
                paint.FillGradientEllipse(COLOR.ARGB(255, 40, 24), COLOR.ARGB(255, 120, 40), drawRect, 45);
            }
            else
            {
                paint.FillGradientEllipse(COLOR.ARGB(90, 120, 24), COLOR.ARGB(122, 156, 40), drawRect, 45);
            }
        }
Ejemplo n.º 29
0
 /// <summary>
 /// 重绘前景方法
 /// </summary>
 /// <param name="paint">绘图对象</param>
 /// <param name="clipRect">裁剪区域</param>
 public override void OnPaintBackground(CPaint paint, RECT clipRect)
 {
     base.OnPaintBackground(paint, clipRect);
     lock (m_barrages)
     {
         int barragesSize = m_barrages.Count;
         for (int i = 0; i < barragesSize; i++)
         {
             Barrage brg  = m_barrages[i];
             FONT    font = brg.Font;
             RECT    rect = brg.Rect;
             String  str  = brg.Text;
             SIZE    size = paint.TextSize(str, font);
             rect.right  = rect.left + size.cx;
             rect.bottom = rect.top + size.cy;
             brg.Rect    = rect;
             long color = brg.Color;
             int  mode  = brg.Mode;
             if (mode == 1)
             {
                 int a = 0, r = 0, g = 0, b = 0;
                 COLOR.ToARGB(null, color, ref a, ref r, ref g, ref b);
                 a     = a * brg.Tick / 400;
                 color = COLOR.ARGB(a, r, g, b);
             }
             if (mode == 2)
             {
                 POINT[] points = new POINT[5];
                 int     mWidth = rect.right - rect.left, mHeight = rect.bottom - rect.top;
                 points[0] = new POINT(rect.left, rect.top + mHeight / 2 + 1);
                 points[1] = new POINT(rect.left + 20, rect.top);
                 points[2] = new POINT(rect.right, rect.top);
                 points[3] = new POINT(rect.right, rect.bottom);
                 points[4] = new POINT(rect.left + 20, rect.bottom);
                 RECT drawRect = new RECT(rect.left - 30, rect.top - 10, rect.right + 30, rect.bottom + 10);
                 paint.DrawImage("file='fire2.jpg' highcolor='150,150,150' lowcolor='0,0,0'", drawRect);
                 //paint.FillGradientPolygon(COLOR.ARGB(255, 120, 40), COLOR.ARGB(255, 80, 40), points, 90);
             }
             else
             {
                 paint.DrawText(str, color, font, rect);
             }
         }
     }
 }
Ejemplo n.º 30
0
        public override void OnPaint(CPaint paint, RECT rect, RECT clipRect, bool isAlternate)
        {
            RECT textRect = new RECT(rect.left + 10, rect.top + 2, rect.right - 10, rect.bottom - 2);

            paint.FillRoundRect(CDraw.PCOLORS_BACKCOLOR, textRect, 3);
            String text   = Text;
            FONT   font   = new FONT();
            SIZE   tSize  = paint.TextSize(text, font);
            RECT   tRect  = new RECT();
            int    width  = textRect.right - textRect.left;
            int    height = textRect.bottom - textRect.top;

            tRect.left   = textRect.left + (width - tSize.cx) / 2;
            tRect.top    = textRect.top + (height - tSize.cy) / 2;
            tRect.right  = tRect.left + tSize.cx;
            tRect.bottom = tRect.top + tSize.cy;
            paint.DrawText(text, COLOR.ARGB(255, 255, 255), font, tRect);
        }