Пример #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);
        }
Пример #2
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);
        }
Пример #3
0
        private void BtnLayer_GDIPaint(GDIGraphics g)
        {
            Graphics graphis = g.GdiGraph;

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

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

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

            if (!IsUsedProgressAnim)
            {
                Brush      progressBrush = new SolidBrush(progressbarColor);
                float      progressWidth = progress * 0.01f * btnLayer.Width;
                RectangleF progressRect  = new RectangleF(0, 0, progressWidth, btnLayer.Height);
                graphis.FillRectangle(progressBrush, progressRect);
                progressBrush.Dispose();
            }
            else
            {
                Brush      progressBrush;
                float      progressWidth;
                RectangleF progressRect;

                if (animProgress < 100)
                {
                    progressBrush = new SolidBrush(Color.FromArgb(130, progressbarColor));
                    progressWidth = progress * 0.01f * btnLayer.Width;
                    progressRect  = new RectangleF(0, 0, progressWidth, btnLayer.Height);
                    graphis.FillRectangle(progressBrush, progressRect);
                }

                progressBrush = new SolidBrush(Color.FromArgb(255, progressbarColor));
                progressWidth = animProgress * 0.01f * btnLayer.Width;
                progressRect  = new RectangleF(0, 0, progressWidth, btnLayer.Height);
                graphis.FillRectangle(progressBrush, progressRect);
                progressBrush.Dispose();
            }

            //
            ScTxtInfo txtInfo = new ScTxtInfo();

            for (int i = 0; i < TxtRowCount; i++)
            {
                rect = txtTable.GetCellContentRect(i, 0);


                if (rowTextInfoList[i] != null)
                {
                    if (rowTextInfoList[i].txt != null)
                    {
                        txtInfo.txt = rowTextInfoList[i].txt;
                    }
                    else
                    {
                        txtInfo.txt = "";
                    }

                    if (rowTextInfoList[i].txtFont != null)
                    {
                        txtInfo.txtFont = rowTextInfoList[i].txtFont;
                    }
                    else
                    {
                        txtInfo.txtFont = txtFont;
                    }

                    if (rowTextInfoList[i].txtColor != null)
                    {
                        txtInfo.txtColor = rowTextInfoList[i].txtColor;
                    }
                    else
                    {
                        txtInfo.txtColor = txtColor;
                    }
                }
                else
                {
                    continue;
                }

                brush = new SolidBrush(txtInfo.txtColor);
                DrawUtils.LimitBoxDraw(graphis, txtInfo.txt, txtInfo.txtFont, brush, rect, false, true, 0);
                brush.Dispose();
            }


            if (isShowGow)
            {
                //
                //  rect = new RectangleF(btnLayer.Width - 30, btnLayer.Height - 30, 30, 30);
                // GraphicsPath path = CreateGouPath(rect);
                graphis.FillPath(Brushes.Green, gouPath);
                //path.Dispose();
            }


            if (isSelected)
            {
                rect = new RectangleF(0, 0, btnLayer.Width - 1, btnLayer.Height - 1);
                GraphicsPath path = DrawUtils.CreateRoundedRectanglePath(rect, 6);

                Pen pen = new Pen(Color.FromArgb(155, Color.Black));
                graphis.DrawPath(pen, path);
                graphis.DrawPath(pen, path);
            }
        }