mForeground.setColor(mOldColor[i] | makeGreen(i)); mForeground.setAlpha(((NUM_OLD-i) * 255) / NUM_OLD); int p = i*4; if (blue > 255) blue = 255; int color = 0xff000000 | (red<<16) | blue; mForeground.setColor(color | makeGreen(-2)); canvas.drawLine(mPoint1.x, mPoint1.y, mPoint2.x, mPoint2.y, mForeground);
mForeground.setColor(mOldColor[i] | makeGreen(i)); mForeground.setAlpha(((NUM_OLD-i) * 255) / NUM_OLD); int p = i*4; if (blue > 255) blue = 255; int color = 0xff000000 | (red<<16) | blue; mForeground.setColor(color | makeGreen(-2)); canvas.drawLine(mPoint1.x, mPoint1.y, mPoint2.x, mPoint2.y, mForeground);
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Tell the activity's window that we want to do our own drawing // to its surface. This prevents the view hierarchy from drawing to // it, though we can still add views to capture input if desired. getWindow().takeSurface(this); // This is the thread that will be drawing to our surface. mDrawingThread = new DrawingThread(); mDrawingThread.start(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Tell the activity's window that we want to do our own drawing // to its surface. This prevents the view hierarchy from drawing to // it, though we can still add views to capture input if desired. getWindow().takeSurface(this); // This is the thread that will be drawing to our surface. mDrawingThread = new DrawingThread(); mDrawingThread.start(); }