Beispiel #1
0
 protected override void BeforeTransform(Graphics g, float scaleFactor)
 {
     using (var smoothing = new SmoothingOption(g, System.Drawing.Drawing2D.SmoothingMode.Default))
     {
         using (var brush = new SolidBrush(BackgroundColor.ToColor()))
         {
             g.FillRectangle(brush, g.VisibleClipBounds);
         }
     }
     base.BeforeTransform(g, scaleFactor);
 }
        public virtual void Render(Graphics g, float scaleFactor)
        {
            RectangleF rect = new RectangleF(Left * scaleFactor, Top * scaleFactor, Width * scaleFactor, Height * scaleFactor);

            using (var smoothing = new SmoothingOption(g, Smooth? System.Drawing.Drawing2D.SmoothingMode.AntiAlias : System.Drawing.Drawing2D.SmoothingMode.Default))
            {
                using (var brush = Color.ParseBrush(rect))
                {
                    g.FillRectangle(brush, rect);
                }
            }
        }