【发布时间】:2017-10-24 20:24:21
【问题描述】:
Image sample 我有这个方法来裁剪我的图像,但是高度尺寸在裁剪上不起作用,只有重量是正确的。我找不到问题。我想使用我的屏幕宽度和高度作为动态宽度和高度。
public Bitmap cropToSquare(Bitmap bitmap){
int width = mScreenWidth ;
int height = mScreenHeight;
int newWidth = width - 2 * 10;
int newHeight = (height- newWidth) / 2;
Bitmap cropImg = Bitmap.createBitmap(bitmap, 0, 0, newWidth, newHeight);
return cropImg; }
}
【问题讨论】:
-
请说明你想通过附上快照实现什么;这将有助于我们更好地理解问题!!!!!!
标签: java android image crop createbitmap