Exemple #1
0
        protected override GraphicsPath CreateHitGeometryByGDIPLUS(GDIGraphics g)
        {
            RectangleF   rect = new RectangleF(0, 0, Width - 1, Height - 1);
            GraphicsPath path = DrawUtils.CreateRoundedRectanglePath(rect, 6);

            return(path);
        }
Exemple #2
0
        public void Paint(PaintEventArgs e)
        {
            if (rootScLayer == null)
            {
                return;
            }

            if (graphics == null)
            {
                return;
            }

            Rectangle refreshArea = e.ClipRectangle;

            if (graphicsType == GraphicsType.GDIPLUS)
            {
                GDIGraphics gdig = (GDIGraphics)graphics;
                gdig.RootGdiGraph = e.Graphics;
                gdig.BeginDraw();
                reDrawTree.ReCreateReDrawTree(rootScLayer, refreshArea);
                reDrawTree.Draw(gdig);
                gdig.EndDraw();
            }
            else if (GraphicsType == GraphicsType.D2D)
            {
                _PaintByD2D(refreshArea);
            }
        }
Exemple #3
0
        private void ScVxTipsProgressBar_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode     = SmoothingMode.HighQuality;
            graphis.TextRenderingHint = TextRenderingHint.AntiAlias;


            ScProgressNodeAnim nodeAnim;

            ScProgressNodeAnim[] progressNodeAnims = progressBar.progressNodeAnims;
            RectangleF           r;
            Brush  brush;
            float  n = 100f / progressNodeAnims.Count();
            float  val;
            string strVal;

            for (int i = 0; i < progressNodeAnims.Count(); i++)
            {
                nodeAnim = progressNodeAnims[i];

                if (nodeAnim.animScaleValue >= 1.0f)
                {
                    r = progressNumRects[i];

                    val    = (i + 1) * n;
                    strVal = Math.Round(val, 0) + "%";

                    brush = new SolidBrush(numColor);
                    DrawUtils.LimitBoxDraw(graphis, strVal, numFont, brush, r, true, 0);
                    brush.Dispose();
                }
            }
        }
Exemple #4
0
        private void ScVxPageTips_GDIPaint(GDIGraphics g)
        {
            if (alpha == 0)
            {
                return;
            }

            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode     = SmoothingMode.HighQuality;
            graphis.TextRenderingHint = TextRenderingHint.AntiAlias;

            Color c     = Color.FromArgb(alpha - alpha / 2, bgColor);
            Brush brush = new SolidBrush(c);

            graphis.FillPath(brush, tipsPath);
            brush.Dispose();

            if (isDisplaySide)
            {
                c = Color.FromArgb(alpha, sideColor);
                Pen pen = new Pen(c, sideWidth);
                graphis.DrawPath(pen, tipsPath);
                pen.Dispose();
            }


            //
            c     = Color.FromArgb(alpha, txtColor);
            brush = new SolidBrush(c);
            DrawUtils.LimitBoxDraw(graphis, txt, txtFont, brush, txtRect, true, 0);
            brush.Dispose();
        }
Exemple #5
0
        private void PrePlane_GDIPaint(GDIGraphics g)
        {
            Graphics gdiGraph = g.GdiGraph;

            gdiGraph.SmoothingMode = SmoothingMode.Default;
            //    g.SmoothingMode = SmoothingMode.HighQuality;// 指定高质量、低速度呈现。
            // g.TextRenderingHint = TextRenderingHint.AntiAlias;
            RectangleF rect = new RectangleF(0, 0, prePlane.Width, prePlane.Height);

            Color color    = Color.Black;
            Color orgColor = Color.FromArgb(158, 105, 7);

            switch (preBtnMouseState)
            {
            case 0:
                color = Color.FromArgb(200, orgColor);
                break;

            case 1:
                color = Color.FromArgb(100, orgColor);
                break;

            case 2:
                color = Color.FromArgb(50, orgColor);
                break;
            }


            System.Drawing.Brush brush = new SolidBrush(color);
            gdiGraph.FillRectangle(brush, rect);
        }
Exemple #6
0
        private void ScVxMainBox_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode = SmoothingMode.Default;

            Brush     brush = new SolidBrush(Color.FromArgb(255, 49, 67, 77));
            Rectangle rect  = new Rectangle(0, 0, (int)(Width - 1), (int)(Height - 1));

            graphis.FillRectangle(brush, rect);
            brush.Dispose();

            //
            Color color = Color.FromArgb(255, 125, 175, 175);

            Pen pen = new Pen(color);

            graphis.DrawRectangle(pen, rect);
            pen.Dispose();


            //
            color = Color.FromArgb(100, 125, 175, 175);
            brush = new SolidBrush(color);
            graphis.FillRectangle(brush, splitLineRect);
            brush.Dispose();
        }
Exemple #7
0
        private void ImgLayer_GDIPaint(GDIGraphics g)
        {
            RectangleF rect  = new RectangleF(0, 0, imgLayer.Width, imgLayer.Height);
            Graphics   graph = g.GdiGraph;

            graph.SmoothingMode = SmoothingMode.HighQuality;
            graph.DrawImage(img, rect);
        }
Exemple #8
0
        private void InfoLayer_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            graphis.DrawString("生产进度", new Font("微软雅黑", 11), Brushes.White, 20, 25);
        }
Exemple #9
0
        protected virtual GraphicsPath CreateHitGeometryByGDIPLUS(GDIGraphics g)
        {
            IsUseOrgHitGeometry = true;
            RectangleF   rc           = new RectangleF(0, 0, Width, Height);
            GraphicsPath graphicsPath = new GraphicsPath();

            graphicsPath.AddRectangle(rc);
            return(graphicsPath);
        }
Exemple #10
0
        private void ScChartGridLine_GDIPaint(GDIGraphics g)
        {
            Graphics gdiGraph = g.GdiGraph;

            gdiGraph.SmoothingMode     = SmoothingMode.HighQuality;// 指定高质量、低速度呈现。
            gdiGraph.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            gdiGraph.DrawLine(linePen, startPoint, endPoint);
        }
Exemple #11
0
        protected override GraphicsPath CreateHitGeometryByGDIPLUS(GDIGraphics g)
        {
            RectangleF   rect   = new RectangleF(0, 0, Width - 1, Height - 1);
            GraphicsPath circle = new GraphicsPath();

            circle.AddEllipse(rect);
            circle.CloseFigure();
            return(circle);
        }
Exemple #12
0
        private void TitleBtn_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode = SmoothingMode.HighQuality;
            RectangleF rect = new RectangleF(0, 0, titleBtn.Width, titleBtn.Height);

            DrawUtils.LimitBoxDraw(graphis, titleInfo, titleFont, Brushes.WhiteSmoke, rect, DrawPositionType.Left, true, false, 0);
        }
Exemple #13
0
        private void ScVxSlideScreen_GDIPaint(GDIGraphics g)
        {
            Graphics gdiGraph = g.GdiGraph;

            RectangleF rect = new RectangleF(0, 0, Width, Height);

            System.Drawing.Brush brush = new SolidBrush(Color.DarkGray);
            gdiGraph.FillRectangle(brush, rect);
            brush.Dispose();
        }
Exemple #14
0
        private void ScChartLabel_GDIPaint(GDIGraphics g)
        {
            Graphics gdiGraph = g.GdiGraph;

            gdiGraph.SmoothingMode     = SmoothingMode.HighQuality;// 指定高质量、低速度呈现。
            gdiGraph.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            RectangleF rect = new RectangleF(0, 0, Width, Height);

            Utils.LimitBoxDrawUtils.LimitBoxDraw(gdiGraph, text, textFont, rect, true, 0);
        }
Exemple #15
0
        private void ToolsShadowLayer_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode = SmoothingMode.Default;
            Rectangle           rect  = new Rectangle(0, 0, (int)toolsShadowLayer.Width, (int)toolsShadowLayer.Height);
            LinearGradientBrush brush = new LinearGradientBrush(rect, Color.FromArgb(100, 0, 0, 0), Color.FromArgb(0, 0, 0, 0), LinearGradientMode.Horizontal);

            graphis.FillRectangle(brush, rect);
            brush.Dispose();
        }
Exemple #16
0
        private void ScScrollBarSlider_GDIPaint(GDIGraphics g)
        {
            g.GdiGraph.SmoothingMode = SmoothingMode.None;// 指定高质量、低速度呈现。

            // g.graphics.SmoothingMode = SmoothingMode.HighQuality;
            Color      color = Color.FromArgb(alpha, 191, 152, 90);
            RectangleF rect  = new RectangleF(2, 0, Width - 4 - 1, Height - 1);

            System.Drawing.Brush brush = new SolidBrush(color);
            g.GdiGraph.FillRectangle(brush, rect);
        }
Exemple #17
0
        private void InfoLayer_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode = SmoothingMode.HighQuality;

            RectangleF rect  = new RectangleF(0, 0, infoLayer.Width, infoLayer.Height);
            SolidBrush brush = new SolidBrush(Color.WhiteSmoke);

            DrawUtils.LimitBoxDraw(graphis, info, infoFont, brush, rect, DrawPositionType.Left, true, true, 0);
        }
Exemple #18
0
        private void ClosedBtn_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode = SmoothingMode.HighQuality;

            RectangleF rect = new RectangleF(0, 0, closedBtn.Width, closedBtn.Height);
            Pen        pen  = new Pen(closedBtnColor, 3);

            graphis.DrawLine(pen, 4, 4, rect.Right - 4, rect.Bottom - 4);
            graphis.DrawLine(pen, rect.Right - 4, rect.Top + 4, rect.Left + 4, rect.Bottom - 4);
        }
Exemple #19
0
        private void TitleInfoLayer_GDIPaint(GDIGraphics g)
        {
            Graphics gdiGraph = g.GdiGraph;

            gdiGraph.SmoothingMode     = SmoothingMode.HighQuality;// 指定高质量、低速度呈现。
            gdiGraph.TextRenderingHint = TextRenderingHint.AntiAlias;

            RectangleF rect  = new RectangleF(0, 0, titleInfoLayer.Width, titleInfoLayer.Height);
            Brush      brush = new SolidBrush(Color.FromArgb(153, 114, 49));

            DrawUtils.LimitBoxDraw(gdiGraph, titleInfo, font, brush, rect, true, 0);
        }
Exemple #20
0
        private void ScVxDate_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode     = SmoothingMode.HighQuality;
            graphis.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            RectangleF rect = new RectangleF(0, 0, Width - 1, Height - 1);

            //
            Brush brush = new SolidBrush(bgColor);

            DrawUtils.FillRoundRectangle(graphis, brush, rect, 6);

            Pen pen = new Pen(txtColor);

            DrawUtils.DrawRoundRectangle(graphis, pen, rect, 6);

            //
            brush = new SolidBrush(Color.FromArgb(105, 163, 175));

            rect = mainTable.GetCellContentRect(0, 0);
            string d = dt.ToString("yyyy-MM-dd");

            DrawUtils.LimitBoxDraw(graphis, d, font, brush, rect, true, 0);

            //
            rect = mainTable.GetCellContentRect(0, 1);
            d    = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek);
            DrawUtils.LimitBoxDraw(graphis, d, font, brush, rect, true, 0);


            //
            rect = mainTable.GetCellContentRect(0, 2);
            d    = DateTime.Now.ToLongTimeString().ToString();
            DrawUtils.LimitBoxDraw(graphis, d, font, Brushes.WhiteSmoke, rect, true, 0);

            brush.Dispose();

            //
            LinePos linePos = mainTable.GetColLinePos(0);

            linePos.start = new PointF((int)linePos.start.X, (int)(linePos.start.Y + Height / 7));
            linePos.end   = new PointF((int)linePos.end.X, (int)(linePos.end.Y - Height / 7));
            graphis.DrawLine(pen, linePos.start, linePos.end);

            //
            linePos       = mainTable.GetColLinePos(1);
            linePos.start = new PointF((int)linePos.start.X, (int)(linePos.start.Y + Height / 7));
            linePos.end   = new PointF((int)linePos.end.X, (int)(linePos.end.Y - Height / 7));
            graphis.DrawLine(pen, linePos.start, linePos.end);
        }
Exemple #21
0
        private void ScTextBox_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode     = SmoothingMode.HighQuality;
            graphis.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;


            RectangleF rect = new RectangleF(0, 0, (float)Math.Ceiling(Width - 1), (float)Math.Ceiling(Height - 1));
            Pen        pen  = new Pen(Color.FromArgb(255, 191, 152, 90), 1f);

            DrawUtils.DrawRoundRectangle(graphis, pen, rect, 4);
        }
Exemple #22
0
        private void ScVxMainBox_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode = SmoothingMode.Default;

            Brush      brush = new SolidBrush(bgColor);
            RectangleF rect  = new RectangleF(0, 0, Width, Height);

            graphis.FillRectangle(brush, rect);

            brush.Dispose();
        }
Exemple #23
0
        private void ScVxSearchAndTitle_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode     = SmoothingMode.HighQuality;
            graphis.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            RectangleF rect = mainTable.GetCellContentRect(0, 0);

            Brush brush = new SolidBrush(titleColor);

            DrawUtils.LimitBoxDraw(graphis, title, titlefont, brush, rect, false, true, 0);
            brush.Dispose();
        }
Exemple #24
0
        private void OkBtn_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode = SmoothingMode.HighQuality;

            RectangleF rect = new RectangleF(0, 0, okBtn.Width, okBtn.Height);

            Brush brush = new SolidBrush(okBtnColor);

            graphis.FillRectangle(brush, rect);

            DrawUtils.LimitBoxDraw(graphis, okBtnText, okBtnFont, Brushes.WhiteSmoke, rect, DrawPositionType.Center, true, false, 0);
        }
Exemple #25
0
        private void LeftScreen_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode = SmoothingMode.HighQuality;

            RectangleF r;

            for (int i = 0; i < imgList.Count(); i++)
            {
                r = mainTable.GetCellContentRect(0, i);
                graphis.DrawImage(imgList[i], r.X + r.Width / 2 - imgList[i].Width / 2, r.Y + r.Height / 2 - imgList[i].Height / 2);
            }
        }
Exemple #26
0
        private void Search_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode = SmoothingMode.HighQuality;

            RectangleF rect = new RectangleF(0, 0, Width, Height);
            RectangleF r    = new RectangleF(rect.X + 8, rect.Y + 8, 12, 12);

            Pen pen = new Pen(searchColor, 2);

            graphis.DrawEllipse(pen, r);

            graphis.DrawLine(pen, rect.X + 18, rect.Y + 18, rect.X + 26, rect.Y + 26);
        }
Exemple #27
0
        private void ViewShadowLayer_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;

            graphis.DrawString("订单完成情况", new Font("微软雅黑", 11), Brushes.White, 20, 10);


            graphis.SmoothingMode = SmoothingMode.Default;
            Rectangle           rect  = new Rectangle(0, 0, (int)viewShadowLayer.Width, (int)viewShadowLayer.Height);
            LinearGradientBrush brush = new LinearGradientBrush(rect, Color.FromArgb(80, 0, 0, 0), Color.FromArgb(0, 0, 0, 0), LinearGradientMode.Vertical);

            graphis.FillRectangle(brush, rect);
            brush.Dispose();
        }
Exemple #28
0
        private void ScVxButton_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

            graphis.SmoothingMode = SmoothingMode.HighQuality;

            if (haloBitmap != null && isSelected)
            {
                ColorDisplace.DisplaceAlpha(haloBitmap, animHaloAlphaScale, haloAlphaMask);
                graphis.DrawImage(haloBitmap, 0, 0);
            }
            else if (shadowBitmap != null)
            {
                graphis.DrawImage(shadowBitmap, 0, 0);
            }
        }
Exemple #29
0
        protected override GraphicsPath CreateHitGeometryByGDIPLUS(GDIGraphics g)
        {
            GraphicsPath graphPath = null;

            switch (style)
            {
            case ScTabItemStyle.Style1:
                graphPath = CreateHitGeometryStyle1ByGDIPLUS();
                break;

            case ScTabItemStyle.Style2:
                break;
            }

            return(graphPath);
        }
Exemple #30
0
        protected override GraphicsPath CreateHitGeometryByGDIPLUS(GDIGraphics g)
        {
            float r = BarHeight / 3;

            GraphicsPath path = DrawUtils.CreateRoundedRectanglePath(barRect, r);

            path.FillMode = FillMode.Winding;

            for (int i = 0; i < progressNodeRects.Count(); i++)
            {
                path.StartFigure();
                path.AddEllipse(progressNodeRects[i]);
                path.CloseFigure();
            }

            return(path);
        }