Beispiel #1
0
 private void Update(object sender, EventArgs e)
 {
     tick++;
     for (int i = 0; i < Program.healthBars.Count; i++)
     {
         PixelStrip strip = Program.healthBars.GetStrip(i);
         if (String.IsNullOrEmpty(strip.id))
         {
             strip.Rainbow(tick);
         }
     }
     Invalidate();
 }
Beispiel #2
0
 protected override void OnPaint(PaintEventArgs e)
 {
     base.OnPaint(e);
     for (int i = 0; i < Program.healthBars.Count; i++)
     {
         PixelStrip strip  = Program.healthBars.GetStrip(i);
         RGBPixel[] pixels = strip.GetPixels;
         for (int j = 0; j < pixels.Length; j++)
         {
             System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(Color.FromArgb(pixels[j].Red, pixels[j].Green, pixels[j].Blue));
             e.Graphics.FillRectangle(myBrush, new Rectangle(i, 1 + j, 1, 1));
             myBrush.Dispose();
         }
     }
 }