- // Exemple d'utilisation :
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
-
- e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
- // on va peindre des rectangles arrondis :D
- RoundedRectangle rr = new RoundedRectangle(10, 10, 100, 100, RoundedCorner.All, 16);
-
- e.Graphics.FillPath(SystemBrushes.WindowText, rr.ToGraphicsPath());
-
- rr.Offset(110, 0);
- e.Graphics.DrawPath(SystemPens.WindowText, rr.ToGraphicsPath());
-
- rr.Offset(110, 0);
- rr.RoundedCorners = RoundedCorner.TopLeft | RoundedCorner.BottomRight;
- e.Graphics.FillPath(
- new LinearGradientBrush(rr.ToRectangle(), SystemColors.ActiveCaption, SystemColors.GradientActiveCaption, LinearGradientMode.ForwardDiagonal),
- rr.ToGraphicsPath());
-
- }
// Exemple d'utilisation :
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
// on va peindre des rectangles arrondis :D
RoundedRectangle rr = new RoundedRectangle(10, 10, 100, 100, RoundedCorner.All, 16);
e.Graphics.FillPath(SystemBrushes.WindowText, rr.ToGraphicsPath());
rr.Offset(110, 0);
e.Graphics.DrawPath(SystemPens.WindowText, rr.ToGraphicsPath());
rr.Offset(110, 0);
rr.RoundedCorners = RoundedCorner.TopLeft | RoundedCorner.BottomRight;
e.Graphics.FillPath(
new LinearGradientBrush(rr.ToRectangle(), SystemColors.ActiveCaption, SystemColors.GradientActiveCaption, LinearGradientMode.ForwardDiagonal),
rr.ToGraphicsPath());
}