0
の残りの部分を描くアンドロイド私はそうあなたが助けてくださいfar.Couldことを達成するためのビットマップから四角形をトリミングしcanvas.Could上の画像の残りの部分を描画しようとしていますか?コードは、コード -Javaは矩形を削除し、画像
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), ARGB_8888);
Canvas canvas = new Canvas(bitmap);
Paint p = new Paint();
p.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DARKEN));
activity.getWindow().getDecorView().draw(canvas);
canvas.drawRect(rect,p);
canvas.save();
以下手動矩形座標又は供給イメージを計算することができ、我々が使用できるアクティビティのビットマップから矩形部分を除去するためにbelow-
1. //draw activity on the canvas. this returns a bitmap used in Bitmap.createBitmap(3)
activity.getWindow().getDecorView().draw(canvas);
2. //get the coordinates that I want to clip.
Rect removeImage = new rect(coordinates of rect portion)
3. //check that I can get the cropped image
Bitmap croppedImage = Bitmap.createBitmap(bitmap, leftCrop, topCrop, rightCrop, bottomCrop);
4. //Now I want to get the remaining canvas and remove the rectangular region
?????????
その 'createBitmap(ビットマップソース、 INT X、 INT yを、 INT幅、 INT高さ)'はなく 'createBitmap(ビットマップをソース、 int型は、x、int型 yを、 int型の右、 int型の下部) '、また、あなたは' ' "私は残りのキャンバスを取得したい" とはどういう意味ですか?私は私がしたいことは維持することであるとして、ここで、(長方形がxで始まる、yは幅と高さを持つ私が指定)createBitmap(ビットマップソース、int型のx、int型のy、int型の幅、int型の高さが)私にトリミングされた画像を与えることだった何を意味するのか – pskink
残りの画像はここに示すようにhttp://www.screencast.com/t/iZlJ0cCDrIH – Galileo123
です。キャンバスAPIを使用してオリジナルのビットマップから任意の領域を削除/クリアします – pskink