Issue
As I searched about this topic in Google, 1.
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
options.inSampleSize = 3;
if (bitmap == null) {
bitmap = BitmapFactory.decodeFile(filePath, options);
}
It means the file pixel is reduced like 1000*1000 to 300*300. and
2.
bitmap.compress(CompressFormat.JPEG, 80, bos);
It means the size(file volume) is reduced like 1000kb -> 800kb.
Is it right? Because... when I upload some images, if the file is big, i failed to upload. (I checked the file volume is reduced by 2nd way, not 1st way)
so I try 1st way but also fail. but when i try 2nd way, I got success!!
so That's the reason why I ask this question.
C.f> If i cropped bitmap, the bitmap is changed???
Bitmap croppedBitmap = null;
if (i!=cnt) {
if ((croppedStart + pageHeight) > webview.getMeasuredHeight()) {
int lastHeight = webview.getMeasuredHeight() - croppedStart;
croppedBitmap = Bitmap.createBitmap(bitmap, 0, croppedStart, webview.getMeasuredWidth(),lastHeight-1);
} else {
try{
croppedBitmap = Bitmap.createBitmap(bitmap, 0, croppedStart, webview.getMeasuredWidth(), pageHeight);
}catch(Exception e){
e.printStackTrace();
}
}
croppedStart += pageHeight;
rtn.add(croppedBitmap);
}
after I do this, my bitmap(orginal) is changed fullBtimap to Last croppedBitmap. also Thanks!
Solution
Quality works only lossy format like jpeg and affects the quality of the image. inSampleSize
requests to subsample the original image. It affects both width and height, meaning that the final image will be 1/inSampleSize
smaller, in width and height of the original
Answered By - Blackbelt
Answer Checked By - Robin (JavaFixing Admin)