Closed kwong93 closed 6 years ago
I just wrote some function to resize, works for now
function resize(sourceImage, targetWidth) {
var sourceWidth = sourceImage.getWidth();
if (sourceWidth < targetWidth) {
return null;
}
var sourceHeight = sourceImage.getHeight();
var adjustedHeight = (targetWidth * sourceHeight) / sourceWidth;
var resizedImage = android.graphics.Bitmap.createScaledBitmap(sourceImage, targetWidth, adjustedHeight, true);
return resizedImage;
}
When getting the Bitmap of the drawing, the size is different depending on the device used. For example:
10 inch tablet (Verizon Ellipses) Width: 563 Height: 165
Samsung Galaxy S7 Width: 1500 Height: 440
I am guessing the native library is using the pixel density of the device S7: 577 ppi tablet: 224 ppi
Any way to resize the bitmap so it stays consistent?