-1

我想裁剪bitmap我在图像视图中设置的Linearayout. 我正在使用此代码。什么是裁剪代码"cropimage"

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.screen4);
        // Screen3.crop
        ImageView cropimage = (ImageView) findViewById(R.id.cropimage);
        bm = Screen3.crop;
        cropimage.setImageBitmap(bm);

 }//onCreate 
4

1 回答 1

0

也许这就是你想要的:

imageView.setDrawingCacheEnabled(true);
Bitmap bmCache = imageView.getDrawingCache();
Bitmap bm = null;
if (bmCache != null) {
    bm = Bitmap.createBitmap(bmCache);
}
cropimage.setImageBitmap(bm);
imageView.destroyDrawingCache();
imageView.setDrawingCacheEnabled(false);
于 2015-03-03T10:34:56.950 回答