title: Android FingerPaint Example using Canvas, what is the offscreen Canvas?
body: <p>Hi I was reading the <a href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/FingerPaint.html" rel="nofollow">fingerpaint</a> example, because I'm building a signature activity, that allows the user to draw a signature on the cellphone and then save it to SD.</p>
  
  <p>So far I've seen that the mPath variables holds the path that the user is currently drawing, and this path is drawn onto the screen on the onDraw(..) method by calling </p>
  
  <pre><code>canvas.drawPath(mPath, mPaint);
  </code></pre>
  
  <p>However on the example there is another canvas "mCanvas" that draws the path on the touch listener:</p>
  
  <pre><code>private void touch_up() {
      mPath.lineTo(mX, mY);
      // commit the path to our offscreen
      mCanvas.drawPath(mPath, mPaint);
      // kill this so we don't double draw
      mPath.reset();
  }
  </code></pre>
  
  <p>And this is what I don't get. what is exactly this mCanvas  object, and why are they using it in the example, it seems that only the regular canvas from the onDraw method and the mPath variable would have been enough for doing this?</p>