package com.cablenaranja.micanvas;

import android.content.Context;
import android.graphics.Canvas;

import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.view.View;

public class elCanvas extends View {

    Paint pintar = new Paint();
    Rect cuadrado = new Rect(100,100,300,300);

    public elCanvas(Context context) {
        super(context);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        canvas.drawRGB(251,254,213);
        pintar.setColor(Color.WHITE);
        canvas.drawRect(cuadrado, pintar);
        pintar.setStyle(Paint.Style.STROKE);
        pintar.setStrokeWidth(5);
        pintar.setColor(Color.RED);
        canvas.drawRect(cuadrado, pintar);
        pintar.setStyle(Paint.Style.FILL);
        pintar.setColor(Color.BLUE);
        canvas.drawCircle(500,300,100,pintar);
    }
}
