using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; /* * Starting point for this control: * http://www.codeproject.com/KB/progress/iTunes_Bar.aspx * */ namespace ArducopterConfigurator.Views.controls { /// /// [ToolboxBitmap(typeof(System.Windows.Forms.ProgressBar))] public partial class QuadPlanControl : UserControl { public QuadPlanControl() { SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw, true); InitializeComponent(); Width = 50; Height = 50; } /// /// Raises the event. /// /// A that contains the event data. protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; g.SmoothingMode = SmoothingMode.AntiAlias; g.Clear(BackColor); //var bmp = GenerateProcentBarBitmap(Width, Height, BackColor); //g.DrawImage(bmp, 0, 0); } } }