Exemple #1
0
        protected virtual void FillOfficeGlassTopInnerBorder(
            RectangleF originalRectangle,
            Color color1,
            Color color4,
            int borderThicness,
            bool fillEllipse)
        {
            RectangleF rectangleF = RectangleF.Inflate(originalRectangle, (float)-borderThicness, (float)-borderThicness);

            if (this.IsInvalidRectangle(rectangleF))
            {
                return;
            }
            Color        color2        = this.GetColor(this.ReduceAlphaBasedOnOriginal(50, color1));
            Color        color3        = this.GetColor(this.ReduceAlphaBasedOnOriginal(50, color4));
            GradientStop gradientStop1 = new GradientStop(color2, 0.0f);
            GradientStop gradientStop2 = new GradientStop(color3, 1f);

            using (RadBrush linearGradientBrush = this.CreateLinearGradientBrush(rectangleF, new GradientStop[2] {
                gradientStop1, gradientStop2
            }, RadLinearGradientMode.Vertical))
            {
                if (fillEllipse)
                {
                    this.DrawEllipse(rectangleF, linearGradientBrush, (float)borderThicness);
                }
                else
                {
                    this.DrawRectangle(rectangleF, linearGradientBrush, (float)borderThicness);
                }
            }
        }
Exemple #2
0
 public override void DrawText(
     string text,
     Font font,
     RadBrush brush,
     RectangleF rect,
     TextFormat textFormat)
 {
     if (this.textRendererMode == TextRendererMode.GdiPlus)
     {
         if (textFormat != null)
         {
             this.graphics.DrawString(text, font, (Brush)brush.RawBrush, rect, (StringFormat)textFormat);
         }
         else
         {
             this.graphics.DrawString(text, font, (Brush)brush.RawBrush, rect);
         }
     }
     else if (textFormat != null)
     {
         TextRenderer.DrawText((IDeviceContext)this.graphics, text, font, Point.Round(rect.Location), ((SolidBrush)brush.RawBrush).Color, textFormat.TextFormatFlags);
     }
     else
     {
         TextRenderer.DrawText((IDeviceContext)this.graphics, text, font, Point.Round(rect.Location), ((SolidBrush)brush.RawBrush).Color);
     }
 }
Exemple #3
0
 protected void FillRectangle(RectangleF rectangle, RadBrush brush)
 {
     using (Path path = this.CreatePath())
     {
         path.AddRectangle(rectangle);
         this.FillPathCore(path, brush);
     }
 }
Exemple #4
0
 protected void DrawEllipse(RectangleF rectangle, RadBrush brush, float width)
 {
     using (Path path = this.CreatePath())
     {
         path.AddEllipse(rectangle);
         this.DrawPathCore(path, brush, width);
     }
 }
 public void DrawText(
     string text,
     Font font,
     RadBrush brush,
     PointF point,
     TextFormat textFormat)
 {
     this.surface.DrawText(text, font, brush, new RectangleF(point.X, point.Y, 0.0f, 0.0f), textFormat);
 }
 public void DrawText(
     string text,
     Font font,
     RadBrush brush,
     RectangleF rect,
     TextFormat format)
 {
     this.surface.DrawText(text, font, brush, rect, format);
 }
Exemple #7
0
 public override void FillRectangle(
     RadBrush brush,
     float x,
     float y,
     float width,
     float height)
 {
     this.graphics.FillRectangle((Brush)brush.RawBrush, x, y, width, height);
 }
 public void DrawText(
     string text,
     Font font,
     RadBrush brush,
     float x,
     float y,
     TextFormat textFormat)
 {
     this.surface.DrawText(text, font, brush, new RectangleF(x, y, 0.0f, 0.0f), textFormat);
 }
Exemple #9
0
 public override void DrawText(ITextElement element, RadBrush brush, RectangleF rect)
 {
     if (this.textRendererMode == TextRendererMode.GdiPlus)
     {
         this.graphics.DrawString(element.Text, element.Font, (Brush)brush.RawBrush, rect, (StringFormat)element.TextFormat);
     }
     else
     {
         TextRenderer.DrawText((IDeviceContext)this.graphics, element.Text, element.Font, Point.Round(rect.Location), element.ForeColor, element.TextFormat.TextFormatFlags);
     }
 }
Exemple #10
0
        protected override void FillRoundedRectangleCore(
            RoundedRectangle roundedRectangle,
            RadBrush brush)
        {
            GraphicsPath  roundedRectangle1 = roundedRectangle.RawRoundedRectangle as GraphicsPath;
            Brush         rawBrush          = brush.RawBrush as Brush;
            SmoothingMode smoothingMode     = this.graphics.SmoothingMode;

            this.graphics.SmoothingMode = SmoothingMode.AntiAlias;
            this.graphics.FillPath(rawBrush, roundedRectangle1);
            this.graphics.SmoothingMode = smoothingMode;
        }
Exemple #11
0
 protected virtual void FillOfficeGlassMain(
     Color color3,
     RectangleF innerRectangle,
     bool fillEllipse)
 {
     using (RadBrush solidBrush = this.CreateSolidBrush(color3))
     {
         if (fillEllipse)
         {
             this.FillEllipse(innerRectangle, solidBrush);
         }
         else
         {
             this.FillRectangle(innerRectangle, solidBrush);
         }
     }
 }
Exemple #12
0
        protected virtual void FillOfficeGlassOuterBorder(
            RectangleF originalRectangle,
            Color color3,
            int borderThicness,
            bool fillEllipse)
        {
            GradientStop gradientStop1 = new GradientStop(this.ReduceAlphaBasedOnOriginal(100, color3), 0.0f);
            GradientStop gradientStop2 = new GradientStop(color3, 1f);

            using (RadBrush linearGradientBrush = this.CreateLinearGradientBrush(originalRectangle, new GradientStop[2] {
                gradientStop1, gradientStop2
            }, RadLinearGradientMode.Vertical))
            {
                if (fillEllipse)
                {
                    this.DrawEllipse(originalRectangle, linearGradientBrush, (float)borderThicness);
                }
                else
                {
                    this.DrawRectangle(originalRectangle, linearGradientBrush, (float)borderThicness);
                }
            }
        }
Exemple #13
0
        private void FillGel(
            Path path,
            GradientStop[] colorStops,
            float gradientPercentage,
            float gradientPercentage2)
        {
            if (colorStops.Length < 2)
            {
                this.FillSolid(path, colorStops[0].Color);
            }
            else
            {
                this.FillLinear(path, colorStops, 90f);
            }
            RectangleF bounds = path.GetBounds();
            float      num1   = bounds.Height / 2f;
            float      num2   = (float)(int)Math.Round(100.0 * (double)gradientPercentage * 0.2);
            float      num3   = (float)(int)Math.Round((double)num1 * (double)gradientPercentage2 * 0.2);
            RectangleF rect   = new RectangleF(bounds.X + num2, bounds.Y, (float)((double)bounds.Width - (double)num2 * 2.0 - 1.0), num1 - num3 * 2f);

            if (this.IsInvalidRectangle(rect))
            {
                return;
            }
            using (RoundedRectangle roundedRectangle = this.CreateRoundedRectangle(rect, rect.Height / 2f))
            {
                RectangleF   rectangle     = RectangleF.Inflate(rect, 1f, 1f);
                Color        color         = this.GetColor(Color.White);
                GradientStop gradientStop1 = new GradientStop(this.ReduceAlphaBasedOnOriginal(253, color), 0.0f);
                GradientStop gradientStop2 = new GradientStop(this.ReduceAlphaBasedOnOriginal(42, color), 1f);
                using (RadBrush linearGradientBrush = this.CreateLinearGradientBrush(rectangle, new GradientStop[2] {
                    gradientStop1, gradientStop2
                }, RadLinearGradientMode.Vertical))
                    this.FillRoundedRectangleCore(roundedRectangle, linearGradientBrush);
            }
        }
Exemple #14
0
        protected override void FillPathCore(Path path, RadBrush brush)
        {
            GraphicsPath rawPath = path.RawPath as GraphicsPath;

            this.graphics.FillPath(brush.RawBrush as Brush, rawPath);
        }
Exemple #15
0
 private void FillSolid(Path path, Color color)
 {
     using (RadBrush solidBrush = this.CreateSolidBrush(color))
         this.FillPathCore(path, solidBrush);
 }
Exemple #16
0
 public abstract void FillRectangle(
     RadBrush brush,
     float x,
     float y,
     float width,
     float height);
Exemple #17
0
 public void DrawRectangle(RadBrush brush, float x1, float y1, float x2, float y2)
 {
     this.surface.DrawRectangle(brush, x1, y1, x2, y2);
 }
Exemple #18
0
 public void DrawRectangle(RadBrush brush, RectangleF rect)
 {
     this.surface.DrawRectangle(brush, rect.Left, rect.Top, rect.Right, rect.Bottom);
 }
Exemple #19
0
 public abstract void FillPolygon(RadBrush brush, PointF[] points);
Exemple #20
0
 public abstract void DrawRectangle(RadBrush brush, float x1, float y1, float x2, float y2);
Exemple #21
0
 public abstract void DrawText(ITextElement element, RadBrush brush, RectangleF rect);
Exemple #22
0
 protected abstract void DrawPathCore(Path path, RadBrush brush, float width);
Exemple #23
0
 protected override void DrawPathCore(Path path, RadBrush brush, float width)
 {
     using (Pen pen = new Pen(brush.RawBrush as Brush, width))
         this.graphics.DrawPath(pen, path.RawPath as GraphicsPath);
 }
Exemple #24
0
 protected abstract void FillPathCore(Path path, RadBrush brush);
Exemple #25
0
 public abstract void DrawText(
     string text,
     Font font,
     RadBrush brush,
     RectangleF rect,
     TextFormat textFormat);
Exemple #26
0
 protected abstract void FillRoundedRectangleCore(
     RoundedRectangle roundedRectangle,
     RadBrush brush);
Exemple #27
0
 public override void FillPolygon(RadBrush brush, PointF[] points)
 {
     this.graphics.FillPolygon((Brush)brush.RawBrush, points);
 }
Exemple #28
0
 private void FillLinear(Path path, GradientStop[] colorStops, float gradientAngle)
 {
     using (RadBrush linearGradientBrush = this.CreateLinearGradientBrush(path.GetBounds(), colorStops, gradientAngle))
         this.FillPathCore(path, linearGradientBrush);
 }
Exemple #29
0
 public override void DrawRectangle(RadBrush brush, float x1, float y1, float x2, float y2)
 {
     using (Pen pen = new Pen((Brush)brush.RawBrush))
         this.graphics.DrawRectangle(pen, x1, y1, x2, y2);
 }
Exemple #30
0
 public abstract void DrawLine(RadBrush brush, float x1, float y1, float x2, float y2);