package com.cablenaranja.canvaswallpaper;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Point;
import android.graphics.Rect;
import android.view.Display;
import android.view.View;

public class canvasFull extends View {

    Bitmap background;
    Display display;
    Rect screen;

    public canvasFull(Context context) {
        super(context);
        int ancho, alto;
        Point size = new Point();
        background = BitmapFactory.decodeResource(getResources(),R.drawable.fondocanvas);
        display = ((Activity)getContext()).getWindowManager().getDefaultDisplay();
        display.getSize(size);
        ancho = size.x;
        alto = size.y;
        screen = new Rect(0, 0, ancho, alto);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        canvas.drawBitmap(background, null, screen, null);
    }
}
