Hi All,

I need to capture snapshot of webview and write the snapshot into a pdf
file.User should not see the procedure of taking snapshot of web page.

I tried using this code
 this.myWebView.setWebViewClient(new WebViewClient()
        {
                public void onPageFinished(WebView view, String url)
                {
                Picture picture = view.capturePicture();
                System.out.println("PICTURE TAKEN*************");


                Bitmap  b=Bitmap.createBitmap(
                        picture.getWidth(),picture.getHeight(),
Bitmap.Config.ARGB_8888);
                Canvas c = new Canvas( b );

                picture.draw( c );
                FileOutputStream fos = null;

                try {
                    fos = new FileOutputStream("/sdcard/myimage.png" );

                    if ( fos != null )
                        {

                                b.compress(Bitmap.CompressFormat.JPEG, 90,
fos );
                                fos.close();
                        }
                } catch( Exception e ){
                    e.printStackTrace();
                }

                }
          });



But if picture is too large,it give bitmap size exceeds VM budget error.

Can anybody suggest me alternate solution.
Is it possible to split Picture into parts?I didnt get any API for that.

or else is it possible to take part of picture?

Please suggest.

Thanks
Kavitha

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to