Hi, Hanzhen,
I didn’t understand your comments ”only capture a screen size bitmap”.
Does this mean you get an empty screen size bitmap and no content of web page?

Here are my comments:
For android WebView, the content of web page will be drawn into Canvas of 
WebView::draw.
So you can capture it with WebView::draw.

For XWalkView,  the content of web page is rendered into a SurfaceView or 
TextureView instead of the XWalkView’s canvas.  So you cannot get it directly 
from XWalkView::draw.
About this issue,  could you please help to file a bug at jira: 
https://crosswalk-project.org/jira.

As a workaround, I suggest you try this:
Android\frameworks\native\services\surfaceflinger\tests\screencap\Screencap.cpp
Per my understanding, you may wrap it with JNI and using it in java.
(I didn’t  try it and not sure if there would be any permission issues.)

Thanks for you feedback.

From: Crosswalk-help 
[mailto:[email protected]] On Behalf Of 
Hanzhen Liang
Sent: Tuesday, April 7, 2015 11:14 AM
To: [email protected]
Subject: [Crosswalk-help] How can I capture the whole content as bitmap?

Hi CrossWalk Team,

I have a feature to capture the whole content as Bitmap to save into SDCard, 
but I can only capture a screen size bitmap using TextureView. How can I do 
that? BTW, I can do it using WebView.draw(Canvas) method.
_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help

Reply via email to