1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| public class PlateauWindows extends MainActivity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new myView(this));
}
private class myView extends View{
public myView(Context context) {
super(context);
}
@SuppressLint("DrawAllocation")
protected void onDraw(Canvas canvas) {
Bitmap myBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.hexagone);
Bitmap resizedImage = Bitmap.createScaledBitmap(myBitmap, L, H, true);
canvas.drawBitmap(resizedImage, xA, yA, null);
}
} |
Partager