如何裁剪位图?

Nar*_*iya 4 android

我已经从片段中检索了位图,并且我将位图(解码的字节数组)放置在 Imageview 中,我想裁剪此位图

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fr_editcrop, container, false);


    cropphoto = (ImageView)view.findViewById(R.id.cropphoto);
    title = (TextView)view.findViewById(R.id.title);
    title.setText("Crop");

    crop = (Button)view.findViewById(R.id.crop);
    cancel = (Button)view.findViewById(R.id.cancel);

    tmp = getArguments().getString("PHOTO");

    byte [] encodeByte=Base64.decode(tmp,Base64.DEFAULT);
    bmp=BitmapFactory.decodeByteArray(encodeByte, 0, encodeByte.length);
    cropphoto.setImageBitmap(bmp);

    Width = cropphoto.getWidth();
    Height = cropphoto.getHeight();
Run Code Online (Sandbox Code Playgroud)

Ran*_*ku' 7

称呼Bitmap.createBitmap(Bitmap source, int x, int y, int width, int height)

参见参考资料