[英]How to sharpen Image/Bitmap in Android Studio
我需要提高Android Studio中圖像的圖像質量。 圖像來源來自PDF文件。
注意:當我放大頁面時-圖像會銳化,而當我在單個頁面中查看整個頁面時,圖像會非常模糊。
如何使用來提高圖像質量? 我已經閱讀了BitmapFactory上的一些文章,但不清楚如何實現它。 我對android還是很陌生,我感覺自己的方式。
以下是我在應用程序中的代碼:
private void showPage(int index) {
if (mPdfRenderer.getPageCount() <= index) {
return;
}
if (null != mCurrentPage) {
mCurrentPage.close();
}
Bitmap bitmap = Bitmap.createBitmap(mCurrentPage.getWidth(), mCurrentPage.getHeight(),
Bitmap.Config.ARGB_8888);
mCurrentPage.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY);
mImageView.setImageBitmap(bitmap);
updateUi();
}
謝謝!
我發現,如果我手動將圖像重新縮放為更大的dpi大小,它將起作用。 但是,從業務角度來看,此解決方案無法滿足我的需求。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.