title: How can I modify a bitmap and use it later without storing or drawing
body: <p>I'm trying to do some ocr by myself in C#. I originally come from Java and this is my first "project" with C#</p>
  
  <p>So I know, how you can make different ColorMatrizes to draw a processed bitmap in your application. I also do have those, but I want to use the processed picture to better analyze a picture.</p>
  
  <p>Those are my methods to get a ImageAttribute</p>
  
  <pre><code>public static ImageAttributes ToGrayscale(Bitmap b)
  public static ImageAttributes ToNegative(Bitmap b)
  public static ImageAttributes ToSepia(Bitmap b)
  public static ImageAttributes SetBrightness(Bitmap b, float Brightness)
  public static ImageAttributes SetContrast(Bitmap b, float Contrast)
  </code></pre>
  
  <p>This is my method to draw it </p>
  
  <pre><code>Graphics g = this.CreateGraphics();
  g.DrawImage(bmp,new Rectangle(0, 0, bmp.Width, bmp.Height), 
              0, 0, bmp.Width, bmp.Height, 
              GraphicsUnit.Pixel, ImageAnalysis.ToGrayscale(bmp));
  g.Dispose(); 
  </code></pre>
  
  <p>This is what I want: </p>
  
  <pre><code>FindLines( setConrast(toGrayscale(bmp),200) )
  </code></pre>
  
  <p>But I found no method to save the changes permanently to bitmap object. Maybe someone did this before and can help me</p>