コード例 #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);
                }
            }
        }
コード例 #2
0
ファイル: GdiSurface.cs プロジェクト: RichardHaggard/BDC
 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);
     }
 }
コード例 #3
0
 protected void FillRectangle(RectangleF rectangle, RadBrush brush)
 {
     using (Path path = this.CreatePath())
     {
         path.AddRectangle(rectangle);
         this.FillPathCore(path, brush);
     }
 }
コード例 #4
0
 protected void DrawEllipse(RectangleF rectangle, RadBrush brush, float width)
 {
     using (Path path = this.CreatePath())
     {
         path.AddEllipse(rectangle);
         this.DrawPathCore(path, brush, width);
     }
 }
コード例 #5
0
ファイル: GraphicsContext.cs プロジェクト: RichardHaggard/BDC
 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);
 }
コード例 #6
0
ファイル: GraphicsContext.cs プロジェクト: RichardHaggard/BDC
 public void DrawText(
     string text,
     Font font,
     RadBrush brush,
     RectangleF rect,
     TextFormat format)
 {
     this.surface.DrawText(text, font, brush, rect, format);
 }
コード例 #7
0
ファイル: GdiSurface.cs プロジェクト: RichardHaggard/BDC
 public override void FillRectangle(
     RadBrush brush,
     float x,
     float y,
     float width,
     float height)
 {
     this.graphics.FillRectangle((Brush)brush.RawBrush, x, y, width, height);
 }
コード例 #8
0
ファイル: GraphicsContext.cs プロジェクト: RichardHaggard/BDC
 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);
 }
コード例 #9
0
ファイル: GdiSurface.cs プロジェクト: RichardHaggard/BDC
 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);
     }
 }
コード例 #10
0
ファイル: GdiSurface.cs プロジェクト: RichardHaggard/BDC
        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;
        }
コード例 #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);
         }
     }
 }
コード例 #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);
                }
            }
        }
コード例 #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);
            }
        }
コード例 #14
0
ファイル: GdiSurface.cs プロジェクト: RichardHaggard/BDC
        protected override void FillPathCore(Path path, RadBrush brush)
        {
            GraphicsPath rawPath = path.RawPath as GraphicsPath;

            this.graphics.FillPath(brush.RawBrush as Brush, rawPath);
        }
コード例 #15
0
 private void FillSolid(Path path, Color color)
 {
     using (RadBrush solidBrush = this.CreateSolidBrush(color))
         this.FillPathCore(path, solidBrush);
 }
コード例 #16
0
 public abstract void FillRectangle(
     RadBrush brush,
     float x,
     float y,
     float width,
     float height);
コード例 #17
0
ファイル: GraphicsContext.cs プロジェクト: RichardHaggard/BDC
 public void DrawRectangle(RadBrush brush, float x1, float y1, float x2, float y2)
 {
     this.surface.DrawRectangle(brush, x1, y1, x2, y2);
 }
コード例 #18
0
ファイル: GraphicsContext.cs プロジェクト: RichardHaggard/BDC
 public void DrawRectangle(RadBrush brush, RectangleF rect)
 {
     this.surface.DrawRectangle(brush, rect.Left, rect.Top, rect.Right, rect.Bottom);
 }
コード例 #19
0
 public abstract void FillPolygon(RadBrush brush, PointF[] points);
コード例 #20
0
 public abstract void DrawRectangle(RadBrush brush, float x1, float y1, float x2, float y2);
コード例 #21
0
 public abstract void DrawText(ITextElement element, RadBrush brush, RectangleF rect);
コード例 #22
0
 protected abstract void DrawPathCore(Path path, RadBrush brush, float width);
コード例 #23
0
ファイル: GdiSurface.cs プロジェクト: RichardHaggard/BDC
 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);
 }
コード例 #24
0
 protected abstract void FillPathCore(Path path, RadBrush brush);
コード例 #25
0
 public abstract void DrawText(
     string text,
     Font font,
     RadBrush brush,
     RectangleF rect,
     TextFormat textFormat);
コード例 #26
0
 protected abstract void FillRoundedRectangleCore(
     RoundedRectangle roundedRectangle,
     RadBrush brush);
コード例 #27
0
ファイル: GdiSurface.cs プロジェクト: RichardHaggard/BDC
 public override void FillPolygon(RadBrush brush, PointF[] points)
 {
     this.graphics.FillPolygon((Brush)brush.RawBrush, points);
 }
コード例 #28
0
 private void FillLinear(Path path, GradientStop[] colorStops, float gradientAngle)
 {
     using (RadBrush linearGradientBrush = this.CreateLinearGradientBrush(path.GetBounds(), colorStops, gradientAngle))
         this.FillPathCore(path, linearGradientBrush);
 }
コード例 #29
0
ファイル: GdiSurface.cs プロジェクト: RichardHaggard/BDC
 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);
 }
コード例 #30
0
 public abstract void DrawLine(RadBrush brush, float x1, float y1, float x2, float y2);