变焦过程中图像内容无法读取 [英] Image content can not read during zoom
本文介绍了变焦过程中图像内容无法读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我按捏放大缩小图片,我不能阅读图像的内容。这是我的code: -
When i zoom image by pinch , i can not read the content of image . This is my code:-
if(!(it.isEmpty() )) {
Collections.sort(it);
for(int i=0; i<it.size();i++) {
ImageViewTouch imageView = new ImageViewTouch(GalleryTouchTestActivity.this);
imageView.setLayoutParams(new Gallery.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
final Options options = new Options();
options.outHeight = (int) scaleHeight; // new smaller height
options.outWidth = (int) scaleWidth; // new smaller width
options.inScaled = true;
options.inPurgeable = true;
options.inSampleSize = 8;
String photoURL = it.get(i);
Bitmap bitmap = BitmapFactory.decodeFile(photoURL,options);
imageView.setImageBitmap(bitmap);
arrayAdapter.add(imageView);
}
可以在任何一个可以帮助我。我已经检查了很多项目,但无法读取内容。感谢您选中此code和给我你的重要时间
May any one help me . i have checked it many items but unable to read content . thank you for checking this code and giving me your important time
感谢您
推荐答案
您可以使用的WebView
此:
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setAllowFileAccess(true);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setBuiltInZoomControls(true);
String base = Environment.getExternalStorageDirectory().getAbsolutePath().toString();
String imagePath = "file:/"+ base + "/test.jpg";
String html = "<html><head></head><body><img src=\""+ imagePath + "\"></body></html>";
mWebView.loadData(html, "text/html","utf-8");
这篇关于变焦过程中图像内容无法读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文