title: C# - Faster Alternatives to SetPixel and GetPixel for Bitmaps for Windows Forms App
body: <p>I am trying to teach myself C# and have heard from a variety of sources that the functions get and setpixel can be horribly slow. What are some of the alternatives and is the performance improvement really that significant? Thanks in advance!</p>
  
  <p>A chunk of my code for reference:</p>
  
  <pre><code>public static Bitmap Paint(Bitmap _b, Color f)
  {
    Bitmap b = new Bitmap(_b);
    for (int x = 0; x &lt; b.Width; x++) 
    {
      for (int y = 0; y &lt; b.Height; y++) 
      {
        Color c = b.GetPixel(x, y);
        b.SetPixel(x, y, Color.FromArgb(c.A, f.R, f.G, f.B));
      }
    }
    return b;
  }
  </code></pre>