drawingcache

Call to `getDrawingCache` returns null when scroll is enabled

倾然丶 夕夏残阳落幕 提交于 2019-12-17 06:16:25
问题 What is missing in this code? This same code works on ICS. On API 8 the scroll appears and some content goes out of screen. How to get the drawing cache in this case? Code: TableLayout page = (TableLayout) findViewById(R.id.page); page.setDrawingCacheEnabled(true); page.buildDrawingCache(); // getDrawingCache returns null... Bitmap pageBmp = Bitmap.createBitmap(page.getDrawingCache(true)); page.destroyDrawingCache(); page.setDrawingCacheEnabled(false); 回答1: I solved it. Created a bitmap of

Android, Java: Improve quality of Bitmap with getDrawingCache()

拈花ヽ惹草 提交于 2019-12-13 04:36:02
问题 I have a dialog and convert it to a bitmap . Then I want so send it with the Sharing Intent: Bitmap cs = null; v1.setDrawingCacheEnabled(true); v1.buildDrawingCache(true); cs = Bitmap.createBitmap(v1.getDrawingCache()); Canvas canvas = new Canvas(cs); v1.draw(canvas); canvas.save(); v1.setDrawingCacheEnabled(false); String path = Images.Media.insertImage(getContext().getContentResolver(), cs, "MyImage", null); Uri file = Uri.parse(path); Intent sharingIntent = new Intent(Intent.ACTION_SEND);

WebView in ScrollView: “View too large to fit into drawing cache” - how to rework layout?

六月ゝ 毕业季﹏ 提交于 2019-11-27 22:58:43
I have a layout with a ScrollView , which contains the following views: ImageView , TextView , WebView , TextView . (This is because I would like to scroll the whole together, not just the contents of the WebView ) After loading some HTML in the WebView , I receive the following: WARN/View(632): View too large to fit into drawing cache, needs 14236800 bytes, only 1536000 available ...and the content of the WebView won't display. After removing the ScrollView , the warning disappears and all is well, except that I lose the wanted scroll functionality. First: I know that trying to use a

Call to `getDrawingCache` returns null when scroll is enabled

萝らか妹 提交于 2019-11-26 22:59:20
What is missing in this code? This same code works on ICS. On API 8 the scroll appears and some content goes out of screen. How to get the drawing cache in this case? Code: TableLayout page = (TableLayout) findViewById(R.id.page); page.setDrawingCacheEnabled(true); page.buildDrawingCache(); // getDrawingCache returns null... Bitmap pageBmp = Bitmap.createBitmap(page.getDrawingCache(true)); page.destroyDrawingCache(); page.setDrawingCacheEnabled(false); I solved it. Created a bitmap of view size and drew the view into it. TableLayout page = (TableLayout) findViewById(R.id.page); Bitmap pageBmp