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); }
public void DrawPath(PenPlus pen, GraphicsPath path) { SetStatus(GdiPlus.GdipDrawPath(nativeGraphics, pen != null ? pen.nativePen : null, path != null ? path.nativePath : null)); }
public void DrawLines(PenPlus pen, Point[] points) { SetStatus(GdiPlus.GdipDrawLinesI(nativeGraphics, pen.nativePen, points, points.Length)); }
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); }
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); }
public void DrawPie(PenPlus pen, Rectangle rect, float startAngle, float sweepAngle) { DrawPie(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle); }
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); }
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)); }
public void DrawLine(PenPlus pen, Point pt1, Point pt2) { DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y); }
public bool IsOutlineVisible(GraphicsPlus g, Point point, PenPlus pen) { return IsOutlineVisible(g, point.X, point.Y, pen); }
internal GpPen GetNativePen(PenPlus pen) { return pen.nativePen; }
internal GpPen GetNativePen(PenPlus pen) { return(pen.nativePen); }
/// <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; }
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; }
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); }
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); }
public void DrawLine(PenPlus pen, int x1, int y1, int x2, int y2) { SetStatus(GdiPlus.GdipDrawLineI(nativeGraphics, pen.nativePen, x1, y1, x2, y2)); }
public bool IsOutlineVisible(GraphicsPlus g, Point point, PenPlus pen) { return(IsOutlineVisible(g, point.X, point.Y, pen)); }