這是我在指定位置的圖像上繪製矩形的代碼。矩形繪製,但我的問題是,現在我的圖像不顯示。位圖圖像問題android
Bitmap bitmap = Bitmap.createBitmap(50, 50, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
imageView.setImageBitmap(bitmap);
Paint paint = new Paint();
paint.setColor(Color.RED);
paint.setStyle(Paint.Style.FILL_AND_STROKE);
paint.setStrokeWidth(50);
float left = 20;
float topy = 20;
float right = 50;
float bottom = 50;
canvas.drawRect(left, topy, right, bottom, paint);
請告訴我的代碼有什麼問題嗎?
我誤改... – user2291423
現在看起來公平! –
任何想法這裏錯了什麼? – user2291423