Tag Archives: ondraw

2,475 views

Delete Canvas – Fill Canvas Android example

Fill the entire canvas with the specified color. @Override public void onDraw(Canvas canvas) { canvas.drawColor(Color.GREEN); }

Posted in Android Examples Code, Bitmap, drawing | Tagged , , | Comments Off on Delete Canvas – Fill Canvas Android example
18,858 views

Draw color line set stroke width Android basic example

Canvas, drawLine(), setStrokeWidth(), Paint, setAntiAlias(boolean), onDraw() public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new SampleView(this)); }   private static class SampleView extends View {   // CONSTRUCTOR public SampleView(Context context) { super(context); setFocusable(true);   … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , , | Comments Off on Draw color line set stroke width Android basic example