Esempio n. 1
0
        internal void SetAttributes(DataPointAttributes attrib, bool area3D)
        {
            borderColor            = attrib.BorderColor;
            borderWidth            = attrib.BorderWidth;
            borderStyle            = attrib.BorderStyle;
            markerStyle            = attrib.MarkerStyle;
            markerSize             = attrib.MarkerSize;
            markerImage            = attrib.MarkerImage;
            markerImageTranspColor = attrib.MarkerImageTransparentColor;
            markerColor            = attrib.MarkerColor;
            markerBorderColor      = attrib.MarkerBorderColor;
            markerBorderWidth      = attrib.MarkerBorderWidth;
            float num = 96f;

            if (common != null)
            {
                num = common.graph.Graphics.DpiX;
            }
            int num2 = (int)Math.Round(2f * num / 96f);

            if (markerBorderWidth > num2)
            {
                markerBorderWidth = num2;
            }
            if (attrib.MarkerBorderWidth <= 0)
            {
                markerBorderColor = Color.Transparent;
            }
            if (style == LegendImageStyle.Line && borderWidth <= (int)Math.Round(num / 96f))
            {
                borderWidth = num2;
            }
            if (!area3D)
            {
                backGradientType     = attrib.BackGradientType;
                backGradientEndColor = attrib.BackGradientEndColor;
                backImageTranspColor = attrib.BackImageTransparentColor;
                backImage            = attrib.BackImage;
                backImageMode        = attrib.BackImageMode;
                backImageAlign       = attrib.BackImageAlign;
                backHatchStyle       = attrib.BackHatchStyle;
            }
        }
        public void SetAttributes(DataPointAttributes attrib, bool area3D)
        {
            this.borderColor            = attrib.BorderColor;
            this.borderWidth            = attrib.BorderWidth;
            this.borderStyle            = attrib.BorderStyle;
            this.markerStyle            = attrib.MarkerStyle;
            this.markerSize             = attrib.MarkerSize;
            this.markerImage            = attrib.MarkerImage;
            this.markerImageTranspColor = attrib.MarkerImageTransparentColor;
            this.markerColor            = attrib.MarkerColor;
            this.markerBorderColor      = attrib.MarkerBorderColor;
            this.markerBorderWidth      = attrib.MarkerBorderWidth;
            float num = 96f;

            if (this.common != null)
            {
                num = this.common.graph.Graphics.DpiX;
            }
            int num2 = (int)Math.Round(2.0 * num / 96.0);

            if (this.markerBorderWidth > num2)
            {
                this.markerBorderWidth = num2;
            }
            if (attrib.MarkerBorderWidth <= 0)
            {
                this.markerBorderColor = Color.Transparent;
            }
            if (this.style == LegendImageStyle.Line && this.borderWidth <= (int)Math.Round(num / 96.0))
            {
                this.borderWidth = num2;
            }
            if (!area3D)
            {
                this.backGradientType     = attrib.BackGradientType;
                this.backGradientEndColor = attrib.BackGradientEndColor;
                this.backImageTranspColor = attrib.BackImageTransparentColor;
                this.backImage            = attrib.BackImage;
                this.backImageMode        = attrib.BackImageMode;
                this.backImageAlign       = attrib.BackImageAlign;
                this.backHatchStyle       = attrib.BackHatchStyle;
            }
        }
Esempio n. 3
0
        public static void SetChartArea(ChartArea chartArea
                                        , Color backColor
                                        , Color backGradientEndColor
                                        , Color borderColor
                                        , ChartDashStyle borderStyle
                                        , int borderWidth
                                        , ChartHatchStyle chartHatchStyle
                                        , GradientType gradientType
                                        , int shadowOffset
                                        , Color shadowColor
                                        , bool enable3D
                                        , string backImage
                                        , ChartImageAlign chartImageAlign
                                        , ChartImageWrapMode chartImageWrapMode
                                        , Color backImageTranspColor)
        {
            if (!backColor.Equals(Color.Empty))
            {
                chartArea.BackColor = backColor;
            }
            if (!backGradientEndColor.Equals(Color.Empty))
            {
                chartArea.BackGradientEndColor = backGradientEndColor;
            }
            if (!borderColor.Equals(Color.Empty))
            {
                chartArea.BorderColor = borderColor;
            }

            chartArea.BorderStyle = borderStyle;

            if (borderWidth != -1)
            {
                chartArea.BorderWidth = borderWidth;
            }
            if (chartHatchStyle != ChartHatchStyle.None)
            {
                chartArea.BackHatchStyle = chartHatchStyle;
            }
            if (gradientType != GradientType.None)
            {
                chartArea.BackGradientType = gradientType;
            }

            if (shadowOffset != -1)
            {
                chartArea.ShadowOffset = shadowOffset;
            }
            if (!shadowColor.Equals(Color.Empty))
            {
                chartArea.ShadowColor = shadowColor;
            }

            chartArea.Area3DStyle.Enable3D = enable3D;

            if (backImage != null)
            {
                chartArea.BackImage      = backImage;
                chartArea.BackImageAlign = chartImageAlign;
                chartArea.BackImageMode  = chartImageWrapMode;
                if (!backImageTranspColor.Equals(Color.Empty))
                {
                    chartArea.BackImageTranspColor = backImageTranspColor;
                }
            }
        }
Esempio n. 4
0
        public static void DundasChartBase(Chart chart
                                           , ChartImageType chartImageType
                                           , int width
                                           , int height
                                           , BorderSkinStyle borderSkinStyle
                                           , Color borderLineColor
                                           , int borderLineWidth
                                           , Color backColor
                                           , Color backGradientEndColor
                                           , Color borderColor
                                           , ChartDashStyle borderStyle
                                           , int borderWidth
                                           , ChartHatchStyle chartHatchStyle
                                           , GradientType gradientType
                                           , AntiAliasing antiAliasing
                                           , string backImage
                                           , ChartImageWrapMode backImageMode
                                           , ChartImageAlign backImageAlign
                                           , Color backImageTranspColor)
        {
            chart.ImageType = chartImageType;

            if (width != -1)
            {
                chart.Width = width;
            }

            if (height != -1)
            {
                chart.Height = height;
            }

            if (borderSkinStyle != BorderSkinStyle.None)
            {
                chart.BorderSkin.SkinStyle = borderSkinStyle;
            }

            if (!borderLineColor.Equals(Color.Empty))
            {
                chart.BorderLineColor = borderLineColor;
            }

            if (borderLineWidth != -1)
            {
                chart.BorderLineWidth = borderLineWidth;
            }

            if (!backColor.Equals(Color.Empty))
            {
                chart.BackColor = backColor;
            }
            // Set Back Gradient End Color
            if (!backGradientEndColor.Equals(Color.Empty))
            {
                chart.BackGradientEndColor = backGradientEndColor;
            }

            // Set Hatch Style
            // Set Border Color
            if (!borderColor.Equals(Color.Empty))
            {
                chart.BorderColor = borderColor;
            }
            // Set Border Style
            if (borderStyle != ChartDashStyle.NotSet)
            {
                chart.BorderStyle = borderStyle;
            }
            // Set Border Width
            if (borderWidth != -1)
            {
                chart.BorderWidth = borderWidth;
            }

            if (chartHatchStyle != ChartHatchStyle.None)
            {
                chart.BackHatchStyle = chartHatchStyle;
            }
            if (gradientType != GradientType.None)
            {
                chart.BackGradientType = gradientType;
            }

            if (antiAliasing != AntiAliasing.None)
            {
                chart.AntiAliasing = antiAliasing;
            }

            if (backImage != null)
            {
                chart.BackImage      = backImage;
                chart.BackImageMode  = backImageMode;
                chart.BackImageAlign = backImageAlign;

                if (!backImageTranspColor.Equals(Color.Empty))
                {
                    chart.BackImageTranspColor = backImageTranspColor;
                }
            }
        }
        public virtual void DrawBorder(ChartGraphics graph, BorderSkinAttributes borderSkin, RectangleF rect, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageMode, Color backImageTranspColor, ChartImageAlign backImageAlign, GradientType backGradientType, Color backGradientEndColor, Color borderColor, int borderWidth, ChartDashStyle borderStyle)
        {
            RectangleF rectangleF  = graph.Round(rect);
            RectangleF rectangleF2 = rectangleF;
            float      num         = (float)(0.30000001192092896 + 0.40000000596046448 * (float)(borderSkin.PageColor.R + borderSkin.PageColor.G + borderSkin.PageColor.B) / 765.0);
            Color      color       = Color.FromArgb((int)((float)(int)backColor.R * num), (int)((float)(int)backColor.G * num), (int)((float)(int)backColor.B * num));

            num = (float)(num + 0.20000000298023224);
            Color centerColor = Color.FromArgb((int)((float)(int)borderSkin.PageColor.R * num), (int)((float)(int)borderSkin.PageColor.G * num), (int)((float)(int)borderSkin.PageColor.B * num));

            if (borderSkin.PageColor == Color.Transparent)
            {
                centerColor = Color.FromArgb(60, 0, 0, 0);
            }
            Color.FromArgb((int)((float)(int)backColor.R * num), (int)((float)(int)backColor.G * num), (int)((float)(int)backColor.B * num));
            float val = this.defaultRadiusSize;

            val = Math.Max(val, (float)(2.0 * this.resolution / 96.0));
            val = Math.Min(val, (float)(rect.Width / 2.0));
            val = Math.Min(val, (float)(rect.Height / 2.0));
            val = (float)Math.Ceiling((double)val);
            graph.FillRectangle(new SolidBrush(borderSkin.PageColor), rect);
            if (this.drawOutsideTopLeftShadow)
            {
                rectangleF2         = rectangleF;
                rectangleF2.X      -= (float)(val * 0.30000001192092896);
                rectangleF2.Y      -= (float)(val * 0.30000001192092896);
                rectangleF2.Width  -= (float)(val * 0.30000001192092896);
                rectangleF2.Height -= (float)(val * 0.30000001192092896);
                graph.DrawRoundedRectShadowAbs(rectangleF2, this.cornerRadius, val, Color.FromArgb(128, Color.Black), borderSkin.PageColor, this.outsideShadowRate);
            }
            rectangleF2         = rectangleF;
            rectangleF2.X      += (float)(val * 0.30000001192092896);
            rectangleF2.Y      += (float)(val * 0.30000001192092896);
            rectangleF2.Width  -= (float)(val * 0.30000001192092896);
            rectangleF2.Height -= (float)(val * 0.30000001192092896);
            graph.DrawRoundedRectShadowAbs(rectangleF2, this.cornerRadius, val, centerColor, borderSkin.PageColor, this.outsideShadowRate);
            rectangleF2         = rectangleF;
            rectangleF2.Width  -= (float)(val * 0.30000001192092896);
            rectangleF2.Height -= (float)(val * 0.30000001192092896);
            GraphicsPath graphicsPath = graph.CreateRoundedRectPath(rectangleF2, this.cornerRadius);

            graph.DrawPathAbs(graphicsPath, backColor, backHatchStyle, backImage, backImageMode, backImageTranspColor, backImageAlign, backGradientType, backGradientEndColor, borderColor, borderWidth, borderStyle, PenAlignment.Inset);
            if (graphicsPath != null)
            {
                graphicsPath.Dispose();
            }
            if (this.drawScrews)
            {
                RectangleF empty = RectangleF.Empty;
                float      num2  = (float)(val * 0.40000000596046448);
                empty.X      = rectangleF2.X + num2;
                empty.Y      = rectangleF2.Y + num2;
                empty.Width  = (float)(val * 0.550000011920929);
                empty.Height = empty.Width;
                this.DrawScrew(graph, empty);
                empty.X = rectangleF2.Right - num2 - empty.Width;
                this.DrawScrew(graph, empty);
                empty.X = rectangleF2.Right - num2 - empty.Width;
                empty.Y = rectangleF2.Bottom - num2 - empty.Height;
                this.DrawScrew(graph, empty);
                empty.X = rectangleF2.X + num2;
                empty.Y = rectangleF2.Bottom - num2 - empty.Height;
                this.DrawScrew(graph, empty);
            }
            Region region = null;

            if (this.drawBottomShadow)
            {
                rectangleF2         = rectangleF;
                rectangleF2.Width  -= (float)(val * 0.30000001192092896);
                rectangleF2.Height -= (float)(val * 0.30000001192092896);
                region              = new Region(graph.CreateRoundedRectPath(new RectangleF(rectangleF2.X - val, rectangleF2.Y - val, (float)(rectangleF2.Width + 0.5 * val), (float)(rectangleF2.Height + 0.5 * val)), this.cornerRadius));
                region.Complement(graph.CreateRoundedRectPath(rectangleF2, this.cornerRadius));
                graph.Clip          = region;
                rectangleF2.X      -= (float)(0.5 * val);
                rectangleF2.Width  += (float)(0.5 * val);
                rectangleF2.Y      -= (float)(0.5 * val);
                rectangleF2.Height += (float)(0.5 * val);
                graph.DrawRoundedRectShadowAbs(rectangleF2, this.cornerRadius, val, Color.Transparent, Color.FromArgb(175, this.sunken ? Color.White : color), 1f);
                graph.Clip = new Region();
            }
            rectangleF2         = rectangleF;
            rectangleF2.Width  -= (float)(val * 0.30000001192092896);
            rectangleF2.Height -= (float)(val * 0.30000001192092896);
            region              = new Region(graph.CreateRoundedRectPath(new RectangleF((float)(rectangleF2.X + val * 0.5), (float)(rectangleF2.Y + val * 0.5), (float)(rectangleF2.Width - 0.20000000298023224 * val), (float)(rectangleF2.Height - 0.20000000298023224 * val)), this.cornerRadius));
            RectangleF rect2 = rectangleF2;

            rect2.Width  += val;
            rect2.Height += val;
            region.Complement(graph.CreateRoundedRectPath(rect2, this.cornerRadius));
            region.Intersect(graph.CreateRoundedRectPath(rectangleF2, this.cornerRadius));
            graph.Clip = region;
            graph.DrawRoundedRectShadowAbs(rect2, this.cornerRadius, val, Color.Transparent, Color.FromArgb(175, this.sunken ? color : Color.White), 1f);
            graph.Clip = new Region();
        }
        public virtual void DrawBorder(ChartGraphics graph, BorderSkinAttributes borderSkin, RectangleF rect, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageMode, Color backImageTranspColor, ChartImageAlign backImageAlign, GradientType backGradientType, Color backGradientEndColor, Color borderColor, int borderWidth, ChartDashStyle borderStyle)
        {
            RectangleF rectangleF  = graph.Round(rect);
            RectangleF rectangleF2 = rectangleF;
            float      num         = 0.3f + 0.4f * (float)(borderSkin.PageColor.R + borderSkin.PageColor.G + borderSkin.PageColor.B) / 765f;
            Color      color       = Color.FromArgb((int)((float)(int)backColor.R * num), (int)((float)(int)backColor.G * num), (int)((float)(int)backColor.B * num));

            num += 0.2f;
            Color centerColor = Color.FromArgb((int)((float)(int)borderSkin.PageColor.R * num), (int)((float)(int)borderSkin.PageColor.G * num), (int)((float)(int)borderSkin.PageColor.B * num));

            if (borderSkin.PageColor == Color.Transparent)
            {
                centerColor = Color.FromArgb(60, 0, 0, 0);
            }
            Color.FromArgb((int)((float)(int)backColor.R * num), (int)((float)(int)backColor.G * num), (int)((float)(int)backColor.B * num));
            float val = defaultRadiusSize;

            val = Math.Max(val, 2f * resolution / 96f);
            val = Math.Min(val, rect.Width / 2f);
            val = Math.Min(val, rect.Height / 2f);
            val = (float)Math.Ceiling(val);
            graph.FillRectangle(new SolidBrush(borderSkin.PageColor), rect);
            if (drawOutsideTopLeftShadow)
            {
                rectangleF2         = rectangleF;
                rectangleF2.X      -= val * 0.3f;
                rectangleF2.Y      -= val * 0.3f;
                rectangleF2.Width  -= val * 0.3f;
                rectangleF2.Height -= val * 0.3f;
                graph.DrawRoundedRectShadowAbs(rectangleF2, cornerRadius, val, Color.FromArgb(128, Color.Black), borderSkin.PageColor, outsideShadowRate);
            }
            rectangleF2         = rectangleF;
            rectangleF2.X      += val * 0.3f;
            rectangleF2.Y      += val * 0.3f;
            rectangleF2.Width  -= val * 0.3f;
            rectangleF2.Height -= val * 0.3f;
            graph.DrawRoundedRectShadowAbs(rectangleF2, cornerRadius, val, centerColor, borderSkin.PageColor, outsideShadowRate);
            rectangleF2         = rectangleF;
            rectangleF2.Width  -= val * 0.3f;
            rectangleF2.Height -= val * 0.3f;
            GraphicsPath graphicsPath = graph.CreateRoundedRectPath(rectangleF2, cornerRadius);

            graph.DrawPathAbs(graphicsPath, backColor, backHatchStyle, backImage, backImageMode, backImageTranspColor, backImageAlign, backGradientType, backGradientEndColor, borderColor, borderWidth, borderStyle, PenAlignment.Inset);
            graphicsPath?.Dispose();
            if (drawScrews)
            {
                RectangleF empty = RectangleF.Empty;
                float      num2  = val * 0.4f;
                empty.X      = rectangleF2.X + num2;
                empty.Y      = rectangleF2.Y + num2;
                empty.Width  = val * 0.55f;
                empty.Height = empty.Width;
                DrawScrew(graph, empty);
                empty.X = rectangleF2.Right - num2 - empty.Width;
                DrawScrew(graph, empty);
                empty.X = rectangleF2.Right - num2 - empty.Width;
                empty.Y = rectangleF2.Bottom - num2 - empty.Height;
                DrawScrew(graph, empty);
                empty.X = rectangleF2.X + num2;
                empty.Y = rectangleF2.Bottom - num2 - empty.Height;
                DrawScrew(graph, empty);
            }
            Region region = null;

            if (drawBottomShadow)
            {
                rectangleF2         = rectangleF;
                rectangleF2.Width  -= val * 0.3f;
                rectangleF2.Height -= val * 0.3f;
                region              = new Region(graph.CreateRoundedRectPath(new RectangleF(rectangleF2.X - val, rectangleF2.Y - val, rectangleF2.Width + 0.5f * val, rectangleF2.Height + 0.5f * val), cornerRadius));
                region.Complement(graph.CreateRoundedRectPath(rectangleF2, cornerRadius));
                graph.Clip          = region;
                rectangleF2.X      -= 0.5f * val;
                rectangleF2.Width  += 0.5f * val;
                rectangleF2.Y      -= 0.5f * val;
                rectangleF2.Height += 0.5f * val;
                graph.DrawRoundedRectShadowAbs(rectangleF2, cornerRadius, val, Color.Transparent, Color.FromArgb(175, sunken ? Color.White : color), 1f);
                graph.Clip = new Region();
            }
            rectangleF2         = rectangleF;
            rectangleF2.Width  -= val * 0.3f;
            rectangleF2.Height -= val * 0.3f;
            region              = new Region(graph.CreateRoundedRectPath(new RectangleF(rectangleF2.X + val * 0.5f, rectangleF2.Y + val * 0.5f, rectangleF2.Width - 0.2f * val, rectangleF2.Height - 0.2f * val), cornerRadius));
            RectangleF rect2 = rectangleF2;

            rect2.Width  += val;
            rect2.Height += val;
            region.Complement(graph.CreateRoundedRectPath(rect2, cornerRadius));
            region.Intersect(graph.CreateRoundedRectPath(rectangleF2, cornerRadius));
            graph.Clip = region;
            graph.DrawRoundedRectShadowAbs(rect2, cornerRadius, val, Color.Transparent, Color.FromArgb(175, sunken ? color : Color.White), 1f);
            graph.Clip = new Region();
        }
Esempio n. 7
0
        public override void DrawBorder(ChartGraphics graph, BorderSkinAttributes borderSkin, RectangleF rect, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageMode, Color backImageTranspColor, ChartImageAlign backImageAlign, GradientType backGradientType, Color backGradientEndColor, Color borderColor, int borderWidth, ChartDashStyle borderStyle)
        {
            base.drawBottomShadow         = true;
            base.sunken                   = false;
            base.outsideShadowRate        = 0.9f;
            base.drawOutsideTopLeftShadow = false;
            bool drawScrews = base.drawScrews;

            base.drawScrews = false;
            base.DrawBorder(graph, borderSkin, rect, borderSkin.FrameBackColor, borderSkin.FrameBackHatchStyle, borderSkin.FrameBackImage, borderSkin.FrameBackImageMode, borderSkin.FrameBackImageTransparentColor, borderSkin.FrameBackImageAlign, borderSkin.FrameBackGradientType, borderSkin.FrameBackGradientEndColor, borderSkin.FrameBorderColor, borderSkin.FrameBorderWidth, borderSkin.FrameBorderStyle);
            base.drawScrews = drawScrews;
            rect.X         += base.sizeLeftTop.Width;
            rect.Y         += base.sizeLeftTop.Height;
            rect.Width     -= base.sizeRightBottom.Width + base.sizeLeftTop.Width;
            rect.Height    -= base.sizeRightBottom.Height + base.sizeLeftTop.Height;
            if (rect.Width > 0.0 && rect.Height > 0.0)
            {
                float[] array = new float[8];
                array                         = (float[])base.cornerRadius.Clone();
                base.cornerRadius             = this.innerCorners;
                base.drawBottomShadow         = false;
                base.sunken                   = true;
                base.drawOutsideTopLeftShadow = true;
                base.outsideShadowRate        = 1.4f;
                Color pageColor = borderSkin.PageColor;
                borderSkin.PageColor = Color.Transparent;
                base.DrawBorder(graph, borderSkin, rect, backColor, backHatchStyle, backImage, backImageMode, backImageTranspColor, backImageAlign, backGradientType, backGradientEndColor, borderColor, borderWidth, borderStyle);
                borderSkin.PageColor = pageColor;
                base.cornerRadius    = array;
            }
        }
        public virtual void DrawBorder(ChartGraphics graph, BorderSkinAttributes borderSkin, RectangleF rect, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageMode, Color backImageTranspColor, ChartImageAlign backImageAlign, GradientType backGradientType, Color backGradientEndColor, Color borderColor, int borderWidth, ChartDashStyle borderStyle)
        {
            RectangleF rectangleF  = graph.Round(rect);
            RectangleF rect2       = rectangleF;
            float      num         = (float)(0.20000000298023224 + 0.40000000596046448 * (float)(borderSkin.PageColor.R + borderSkin.PageColor.G + borderSkin.PageColor.B) / 765.0);
            Color      centerColor = Color.FromArgb((int)((float)(int)borderSkin.PageColor.R * num), (int)((float)(int)borderSkin.PageColor.G * num), (int)((float)(int)borderSkin.PageColor.B * num));

            if (borderSkin.PageColor == Color.Transparent)
            {
                centerColor = Color.FromArgb(60, 0, 0, 0);
            }
            num = (float)(num + 0.20000000298023224);
            Color centerColor2 = Color.FromArgb((int)((float)(int)borderSkin.PageColor.R * num), (int)((float)(int)borderSkin.PageColor.G * num), (int)((float)(int)borderSkin.PageColor.B * num));
            float val          = this.defaultRadiusSize;

            val = Math.Max(val, (float)(2.0 * this.resolution / 96.0));
            val = Math.Min(val, (float)(rect.Width / 2.0));
            val = Math.Min(val, (float)(rect.Height / 2.0));
            val = (float)Math.Ceiling((double)val);
            graph.FillRectangle(new SolidBrush(borderSkin.PageColor), rect);
            rect2         = rectangleF;
            rect2.Width  -= (float)(val * 0.30000001192092896);
            rect2.Height -= (float)(val * 0.30000001192092896);
            graph.DrawRoundedRectShadowAbs(rect2, this.cornerRadius, (float)(val + 1.0 * this.resolution / 96.0), centerColor2, borderSkin.PageColor, 1.4f);
            rect2         = rectangleF;
            rect2.X       = (float)(rectangleF.X + val / 3.0);
            rect2.Y       = (float)(rectangleF.Y + val / 3.0);
            rect2.Width  -= (float)(val / 3.5);
            rect2.Height -= (float)(val / 3.5);
            graph.DrawRoundedRectShadowAbs(rect2, this.cornerRadius, val, centerColor, borderSkin.PageColor, 1.3f);
            rect2         = rectangleF;
            rect2.X       = (float)(rectangleF.X + 3.0 * this.resolution / 96.0);
            rect2.Y       = (float)(rectangleF.Y + 3.0 * this.resolution / 96.0);
            rect2.Width  -= (float)(val * 0.75);
            rect2.Height -= (float)(val * 0.75);
            GraphicsPath graphicsPath = graph.CreateRoundedRectPath(rect2, this.cornerRadius);

            graph.DrawPathAbs(graphicsPath, backColor, backHatchStyle, backImage, backImageMode, backImageTranspColor, backImageAlign, backGradientType, backGradientEndColor, borderColor, borderWidth, borderStyle, PenAlignment.Inset);
            if (graphicsPath != null)
            {
                graphicsPath.Dispose();
            }
            Region region = new Region(graph.CreateRoundedRectPath(new RectangleF(rect2.X - val, rect2.Y - val, (float)(rect2.Width + val - val * 0.25), (float)(rect2.Height + val - val * 0.25)), this.cornerRadius));

            region.Complement(graph.CreateRoundedRectPath(rect2, this.cornerRadius));
            graph.Clip = region;
            graph.DrawRoundedRectShadowAbs(rect2, this.cornerRadius, val, Color.Transparent, Color.FromArgb(128, Color.Gray), 0.5f);
            graph.Clip = new Region();
        }
Esempio n. 9
0
        public virtual void DrawBorder(ChartGraphics graph, BorderSkinAttributes borderSkin, RectangleF rect, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageMode, Color backImageTranspColor, ChartImageAlign backImageAlign, GradientType backGradientType, Color backGradientEndColor, Color borderColor, int borderWidth, ChartDashStyle borderStyle)
        {
            RectangleF rectangleF  = graph.Round(rect);
            RectangleF rectangleF2 = rectangleF;
            float      num         = 0.2f + 0.4f * (float)(borderSkin.PageColor.R + borderSkin.PageColor.G + borderSkin.PageColor.B) / 765f;
            Color      centerColor = Color.FromArgb((int)((float)(int)borderSkin.PageColor.R * num), (int)((float)(int)borderSkin.PageColor.G * num), (int)((float)(int)borderSkin.PageColor.B * num));

            if (borderSkin.PageColor == Color.Transparent)
            {
                centerColor = Color.FromArgb(60, 0, 0, 0);
            }
            num += 0.2f;
            Color centerColor2 = Color.FromArgb((int)((float)(int)borderSkin.PageColor.R * num), (int)((float)(int)borderSkin.PageColor.G * num), (int)((float)(int)borderSkin.PageColor.B * num));
            float val          = defaultRadiusSize;

            val = Math.Max(val, 2f * resolution / 96f);
            val = Math.Min(val, rect.Width / 2f);
            val = Math.Min(val, rect.Height / 2f);
            val = (float)Math.Ceiling(val);
            graph.FillRectangle(new SolidBrush(borderSkin.PageColor), rect);
            rectangleF2         = rectangleF;
            rectangleF2.Width  -= val * 0.3f;
            rectangleF2.Height -= val * 0.3f;
            graph.DrawRoundedRectShadowAbs(rectangleF2, cornerRadius, val + 1f * resolution / 96f, centerColor2, borderSkin.PageColor, 1.4f);
            rectangleF2         = rectangleF;
            rectangleF2.X       = rectangleF.X + val / 3f;
            rectangleF2.Y       = rectangleF.Y + val / 3f;
            rectangleF2.Width  -= val / 3.5f;
            rectangleF2.Height -= val / 3.5f;
            graph.DrawRoundedRectShadowAbs(rectangleF2, cornerRadius, val, centerColor, borderSkin.PageColor, 1.3f);
            rectangleF2         = rectangleF;
            rectangleF2.X       = rectangleF.X + 3f * resolution / 96f;
            rectangleF2.Y       = rectangleF.Y + 3f * resolution / 96f;
            rectangleF2.Width  -= val * 0.75f;
            rectangleF2.Height -= val * 0.75f;
            GraphicsPath graphicsPath = graph.CreateRoundedRectPath(rectangleF2, cornerRadius);

            graph.DrawPathAbs(graphicsPath, backColor, backHatchStyle, backImage, backImageMode, backImageTranspColor, backImageAlign, backGradientType, backGradientEndColor, borderColor, borderWidth, borderStyle, PenAlignment.Inset);
            graphicsPath?.Dispose();
            Region region = new Region(graph.CreateRoundedRectPath(new RectangleF(rectangleF2.X - val, rectangleF2.Y - val, rectangleF2.Width + val - val * 0.25f, rectangleF2.Height + val - val * 0.25f), cornerRadius));

            region.Complement(graph.CreateRoundedRectPath(rectangleF2, cornerRadius));
            graph.Clip = region;
            graph.DrawRoundedRectShadowAbs(rectangleF2, cornerRadius, val, Color.Transparent, Color.FromArgb(128, Color.Gray), 0.5f);
            graph.Clip = new Region();
        }