예제 #1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            Graphics g = e.Graphics;

            g.CompositingQuality = CompositingQuality.HighQuality;
            g.SmoothingMode      = SmoothingMode.HighQuality;
            g.TextRenderingHint  = System.Drawing.Text.TextRenderingHint.AntiAlias;

            GraphicsPath path  = DrawUtil.CreateRoundedRectanglePath(new Rectangle(0, 0, Width, Height), Height / 4);
            Brush        brush = new SolidBrush(Color.FromArgb(210, 36, 33, 28));

            g.FillPath(brush, path);
            SizeF sizef = g.MeasureString(Content, Font);

            g.DrawString(Content, Font, Brushes.White, new RectangleF((Width - sizef.Width) / 2, (Height - sizef.Height) / 2, sizef.Width, sizef.Height));

            path.Dispose();
            brush.Dispose();
        }