Questions tagged «crop»


9
Android Crop Center的位图
我有正方形或矩形的位图。我站在最短的一边,做这样的事情: int value = 0; if (bitmap.getHeight() <= bitmap.getWidth()) { value = bitmap.getHeight(); } else { value = bitmap.getWidth(); } Bitmap finalBitmap = null; finalBitmap = Bitmap.createBitmap(bitmap, 0, 0, value, value); 然后,我将其缩放为144 x 144位图: Bitmap lastBitmap = null; lastBitmap = Bitmap.createScaledBitmap(finalBitmap, 144, 144, true); 问题是它会裁剪原始位图的左上角,有人有代码来裁剪位图的中心吗?
149 android  bitmap  crop 


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.