我曾经画过背景但是我想让它成为可绘画/图片背景而错误的背景我该怎么办?
public void surfaceCreated(SurfaceHolder arg0) {
Bitmap background = BitmapFactory.decodeResource(context.getResources(), R.drawable.download);
float scale = (float)background.getHeight()/(float)GetHeight();
int newWidth = Math.round(background.getWidth()/scale);
int newHeight = Math.round(background.getHeight()/scale);
scaled = Bitmap.createScaledBitmap(background, newWidth, newHeight, true);
}
public void onDraw(Canvas canvas) {
canvas.drawPicture(mbgdDrawable);// draw the background
}
public void DrawBackground(Canvas canvas) {
canvas.drawBitmap(scaled, mScreenHeight, mScreenWidth,null);
}