Java Android Studio在画布上绘制位图不工作
我想在Android Studio中的Android应用程序画布上绘制一幅图像。c.drawBitmap()函数有一个错误。 它说:“无法解析方法”drawBitmap(android.graphics.Bitmap,int,int,int,int)” 我对Android开发完全陌生,我找不到解决方案。Java Android Studio在画布上绘制位图不工作,java,android,mobile,canvas,android-studio,Java,Android,Mobile,Canvas,Android Studio,我想在Android Studio中的Android应用程序画布上绘制一幅图像。c.drawBitmap()函数有一个错误。 它说:“无法解析方法”drawBitmap(android.graphics.Bitmap,int,int,int,int)” 我对Android开发完全陌生,我找不到解决方案。 谢谢。因为您的参数错误。你要么要,要么要 Bitmap bg; protected void onCreate(Bundle savedInstanceState) { ... bg =
谢谢。因为您的参数错误。你要么要,要么要
Bitmap bg;
protected void onCreate(Bundle savedInstanceState) {
...
bg = BitmapFactory.decodeResource(getResources(), R.drawable.bg);
...
}
public void run() {
...
Canvas c = holder.lockCanvas();
c.drawBitmap(bg, 100, 100, 400, 200); // error occurs here
...
}