Example #1
0
        public bool IsOutlineVisible(GraphicsPlus g, float x, float y, PenPlus pen)
        {
            bool ret;

            SetStatus(GdiPlus.GdipIsOutlineVisiblePathPoint(nativePath, x, y, pen.nativePen, g.nativeGraphics, out ret));
            return(ret);
        }
Example #2
0
 public void DrawPath(PenPlus pen,
                      GraphicsPath path)
 {
     SetStatus(GdiPlus.GdipDrawPath(nativeGraphics,
                                    pen != null ? pen.nativePen : null,
                                    path != null ? path.nativePath : null));
 }
Example #3
0
 public void DrawLines(PenPlus pen, Point[] points)
 {
     SetStatus(GdiPlus.GdipDrawLinesI(nativeGraphics,
                                      pen.nativePen,
                                      points,
                                      points.Length));
 }
Example #4
0
 public void DrawShape(Rectangle rect, int radius, PenPlus pen, GraphicShape shape, RoundedCorners corners)
 {
     if (rect.Width < 1 || rect.Height < 1) return;
     PathFunc func = GetShapeFunc(shape);
     GraphicsPath path = func(rect, radius, 0, PathMode.All, corners);
     this.DrawPath(pen, path);
 }
Example #5
0
        public void DrawRoundRectangle(Rectangle rect, int radius, PenPlus pen)
        {
            if (rect.Width < 1 || rect.Height < 1)
            {
                return;
            }
            GraphicsPath path = GetRoundPath(rect, radius, 0, PathMode.All, RoundedCorners.All);

            this.DrawPath(pen, path);
        }
Example #6
0
 public void DrawPie(PenPlus pen, Rectangle rect, float startAngle, float sweepAngle)
 {
     DrawPie(pen,
             rect.X,
             rect.Y,
             rect.Width,
             rect.Height,
             startAngle,
             sweepAngle);
 }
Example #7
0
        public void DrawShape(Rectangle rect, int radius, PenPlus pen, GraphicShape shape, RoundedCorners corners)
        {
            if (rect.Width < 1 || rect.Height < 1)
            {
                return;
            }
            PathFunc     func = GetShapeFunc(shape);
            GraphicsPath path = func(rect, radius, 0, PathMode.All, corners);

            this.DrawPath(pen, path);
        }
Example #8
0
 public void DrawPie(PenPlus pen,
                     int x,
                     int y,
                     int width,
                     int height,
                     float startAngle,
                     float sweepAngle)
 {
     SetStatus(GdiPlus.GdipDrawPieI(nativeGraphics,
                                    pen.nativePen,
                                    x,
                                    y,
                                    width,
                                    height,
                                    startAngle,
                                    sweepAngle));
 }
Example #9
0
 public void DrawPath(PenPlus pen,
                  GraphicsPath path)
 {
     SetStatus(GdiPlus.GdipDrawPath(nativeGraphics,
                                               pen != null ? pen.nativePen : null,
                                               path != null ? path.nativePath : null));
 }
Example #10
0
 public void DrawLines(PenPlus pen, Point[] points)
 {
     SetStatus(GdiPlus.GdipDrawLinesI(nativeGraphics,
                                                 pen.nativePen,
                                                 points,
                                                 points.Length));
 }
Example #11
0
 public void DrawLine(PenPlus pen, Point pt1, Point pt2)
 {
     DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y);
 }
Example #12
0
 public void DrawLine(PenPlus pen, Point pt1, Point pt2)
 {
     DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y);
 }
Example #13
0
 public bool IsOutlineVisible(GraphicsPlus g, Point point, PenPlus pen)
 {
     return IsOutlineVisible(g, point.X, point.Y, pen);
 }
Example #14
0
 internal GpPen GetNativePen(PenPlus pen)
 {
     return pen.nativePen;
 }
Example #15
0
 internal GpPen GetNativePen(PenPlus pen)
 {
     return(pen.nativePen);
 }
Example #16
0
 public void DrawPie(PenPlus pen, Rectangle rect,  float startAngle, float sweepAngle)
 {
     DrawPie(pen,
                    rect.X,
                    rect.Y,
                    rect.Width,
                    rect.Height,
                    startAngle,
                    sweepAngle);
 }
Example #17
0
 public void DrawPie(PenPlus pen,
                int x,
                int y,
                int width,
                int height,
                float startAngle,
                float sweepAngle)
 {
     SetStatus(GdiPlus.GdipDrawPieI(nativeGraphics,
                                               pen.nativePen,
                                               x,
                                               y,
                                               width,
                                               height,
                                               startAngle,
                                               sweepAngle));
 }
Example #18
0
        /// <summary>
        /// Creates and paints the button bitmap of the virtual scrollbar.
        /// </summary>
        /// <param name="width">The width of the button.</param>
        /// <param name="height">The height of the button.</param>
        /// <returns>The button image.</returns>
        protected virtual Image CreateScrollButtonBitmap(int width, int height)
        {
            Bitmap bm = new Bitmap(width, height);
            using (Graphics g = Graphics.FromImage(bm))
            {
                int r = Math.Min(width, height / 2) - 1;
                if (r < 1) r = 1;

                backgroundBrush.Color = Color.Fuchsia;
                //g.Clear(Color.Fuchsia);
                g.FillRectangle(backgroundBrush, 0, 0, width, height);

                using (GraphicsPlus gp = new GraphicsPlus(g))
                {
                    Rectangle bounds = new Rectangle(0, 0, width - 1, height - 1);
                    gp.SmoothingMode = SmoothingMode.None;
                    Color color = scrollbarButtonColor;
                    using (SolidBrushPlus brush = new SolidBrushPlus(color, true))
                    {
                        gp.FillRoundRectangle(bounds, r, brush);
                    }
                    using (PenPlus pen = new PenPlus(ScrollBarButtonBorderColor, 1, true))
                    {
                        gp.DrawRoundRectangle(bounds, r, pen);
                    }
                }
            }

            return bm;
        }
Example #19
0
 public bool IsOutlineVisible(GraphicsPlus g, float x, float y, PenPlus pen)
 {
     bool ret;
     SetStatus(GdiPlus.GdipIsOutlineVisiblePathPoint(nativePath, x, y, pen.nativePen, g.nativeGraphics, out ret));
     return ret;
 }
Example #20
0
 public void DrawRoundRectangle(Rectangle rect, int radius, PenPlus pen)
 {
     if (rect.Width < 1 || rect.Height < 1) return;
     GraphicsPath path = GetRoundPath(rect, radius, 0, PathMode.All, RoundedCorners.All);
     this.DrawPath(pen, path);
 }
Example #21
0
        protected virtual void PaintButtonBackground(FluidPaintEventArgs e)
        {
            const int const_radius = 8;

            if (this.shape != ButtonShape.Flat || IsDown)
            {
                Rectangle rect = ButtonRectangle;
                rect.Width--;
                rect.Height--;
                if (rect.Width < 1 || rect.Height < 1)
                {
                    return;
                }

                rect.Offset(e.ControlBounds.X, e.ControlBounds.Y);

                Graphics g = e.Graphics;

                int radius = e.ScaleX(const_radius);
                if (radius > rect.Width / 2) radius = rect.Width / 2;

                Color endColor = this.BackColor;
                if (!Enabled)
                {
                    endColor = ColorConverter.AlphaBlendColor(Color.Black, endColor, 128);
                }
                int alpha = Enabled ? 127 : 32;
                Color startColor = ColorConverter.AlphaBlendColor(endColor, Color.White, alpha);  //Color.FromArgb(0x7fffffff);
                Color borderColor = ColorConverter.AlphaBlendColor(endColor, Color.White, 100);

                GraphicShape shape = ButtonShapeToGraphic(this.shape);
                using (GraphicsPlus gp = new GraphicsPlus(g))
                {
                    if (GradientFill)
                    {
                        GraphicsPlus.GradientMode mode = IsDown ? GraphicsPlus.GradientMode.Bottom : GraphicsPlus.GradientMode.Top;
                        gp.GradientFillShape(rect, radius, startColor, endColor, mode, shape, corners);
                        using (PenPlus pen = new PenPlus(borderColor, (float)1))
                        {
                            gp.DrawShape(rect, radius, pen, shape, corners);
                        }
                    }
                    else
                    {
                        if (IsDown)
                        {
                            endColor = ColorConverter.AlphaBlendColor(endColor, endColor, 128);
                        }
                        gp.GradientFillShape(rect, radius, endColor, endColor, GraphicsPlus.GradientMode.Bottom, shape, corners);
                        using (PenPlus pen = new PenPlus(borderColor, (float)1))
                        {
                            gp.DrawShape(rect, radius, pen, shape, corners);
                        }
                    }
                }
            }
            PerformPaintButtonContent(e);
        }
Example #22
0
 public void DrawLine(PenPlus pen, int x1, int y1, int x2, int y2)
 {
     SetStatus(GdiPlus.GdipDrawLineI(nativeGraphics, pen.nativePen, x1, y1, x2, y2));
 }
Example #23
0
 public bool IsOutlineVisible(GraphicsPlus g, Point point, PenPlus pen)
 {
     return(IsOutlineVisible(g, point.X, point.Y, pen));
 }
Example #24
0
 public void DrawLine(PenPlus pen, int x1, int y1, int x2, int y2)
 {
     SetStatus(GdiPlus.GdipDrawLineI(nativeGraphics, pen.nativePen, x1, y1, x2, y2));
 }