Example #1
0
 /**
  * Called whenever the plot needs to be drawn via the Handler, which invokes invalidate(). Should
  * never be called directly; use {@link #redraw()} instead.
  *
  * @param canvas
  */
 @Override
 protected void onDraw(Canvas canvas) {
   if (renderMode == RenderMode.USE_BACKGROUND_THREAD) {
     synchronized (pingPong) {
       Bitmap bmp = pingPong.getBitmap();
       if (bmp != null) {
         canvas.drawBitmap(bmp, 0, 0, null);
       }
     }
   } else if (renderMode == RenderMode.USE_MAIN_THREAD) {
     renderOnCanvas(canvas);
   } else {
     throw new IllegalArgumentException("Unsupported Render Mode: " + renderMode);
   }
 }
Example #2
0
 // 화면 그리기
 public void onDraw(Canvas canvas) {
   canvas.drawBitmap(mBack, 0, 0, null);
   for (int idx = 0; idx < arBall.size(); idx++) {
     arBall.get(idx).Draw(canvas);
   }
 }