melanie987/SpaceInvader — pull request #1 by PetitKevin2B2 (2012-11-19 09:26:37+00:00)
Title: chargement image 

loadimage dans space invader view:

public Bitmap loadImage(int id) {

Drawable raoul;
Resources r = this.getContext().getResources();
raoul = r.getDrawable(id);

int x,y;
x=raoul.getIntrinsicWidth();
y=raoul.getIntrinsicHeight();

Bitmap bitmap = Bitmap.createBitmap(x, y, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
raoul.setBounds(0, 0, x, y);
raoul.draw(canvas);

return bitmap;
}