简体   繁体   中英

how to capture particular size of webview

I want to capture particular size of the webview.I can capture the full image of webview by using "capturePicture()" method. And also capture the visible part of the webview by using the following code:

webview.setDrawingCacheEnabled(true);
               Bitmap bitmap_resize = null;
               try
               {
               bitmap_resize = Bitmap.createBitmap(webview.getDrawingCache());
               }
               catch(Exception e)
               {
                   e.printStackTrace();
               }
           webview.setDrawingCacheEnabled(false);

And i want to capture only vrtical part of the webview. But my question is,Is it possible to capture particular size of webview? Thanks Inadvance.

If u really want to capture the half of the web view screen,

first of all we define the screen size before capture, and capture the screen and take the bitmap as you done previously,

I think the following screen will helps you while capture

v.layout(0, 0, <width>, <height>);  

Then capture the layout.

Have a nice coding guys......

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM