[英]How to sharpen Image/Bitmap in Android Studio
I need to sharpen the image quality of an image in Android Studio. 我需要提高Android Studio中图像的图像质量。 The Source of the images is from a PDF file. 图像来源来自PDF文件。
Note: When I zoom in on the page - the image sharpens and when I view the entire page in a single page, it is extremely blurry. 注意:当我放大页面时-图像会锐化,而当我在单个页面中查看整个页面时,图像会非常模糊。
How can I sharpen the image quality using? 如何使用来提高图像质量? I have read some articles on BitmapFactory, but I am not clear on how to implement it. 我已经阅读了BitmapFactory上的一些文章,但不清楚如何实现它。 I am still fairly new to android and I am feeling my way around. 我对android还是很陌生,我感觉自己的方式。
Below is my code in the app: 以下是我在应用程序中的代码:
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();
}
Thanks! 谢谢!
I found that if I re-scale the image manually to a larger dpi size, it works. 我发现,如果我手动将图像重新缩放为更大的dpi大小,它将起作用。 However, this solution does not fit what I need from a business standpoint. 但是,从业务角度来看,此解决方案无法满足我的需求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.