hard code bitmap configs
This commit is contained in:
parent
e509105909
commit
c283fec0d1
|
@ -412,7 +412,7 @@ public class FileBackend {
|
||||||
float top = (newHeight - scaledHeight) / 2;
|
float top = (newHeight - scaledHeight) / 2;
|
||||||
|
|
||||||
RectF targetRect = new RectF(left, top, left + scaledWidth, top + scaledHeight);
|
RectF targetRect = new RectF(left, top, left + scaledWidth, top + scaledHeight);
|
||||||
Bitmap dest = Bitmap.createBitmap(newWidth, newHeight, source.getConfig());
|
Bitmap dest = Bitmap.createBitmap(newWidth, newHeight, Bitmap.Config.ARGB_8888);
|
||||||
Canvas canvas = new Canvas(dest);
|
Canvas canvas = new Canvas(dest);
|
||||||
canvas.drawBitmap(source, null, targetRect, null);
|
canvas.drawBitmap(source, null, targetRect, null);
|
||||||
return dest;
|
return dest;
|
||||||
|
@ -437,7 +437,7 @@ public class FileBackend {
|
||||||
float top = (size - outHeight) / 2;
|
float top = (size - outHeight) / 2;
|
||||||
RectF target = new RectF(left, top, left + outWidth, top + outHeight);
|
RectF target = new RectF(left, top, left + outWidth, top + outHeight);
|
||||||
|
|
||||||
Bitmap output = Bitmap.createBitmap(size, size, input.getConfig());
|
Bitmap output = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
|
||||||
Canvas canvas = new Canvas(output);
|
Canvas canvas = new Canvas(output);
|
||||||
canvas.drawBitmap(input, null, target, null);
|
canvas.drawBitmap(input, null, target, null);
|
||||||
return output;
|
return output;
|
||||||
|
|
Loading…
Reference in a new issue