
Untitled
By: a guest on
May 21st, 2012 | syntax:
None | size: 0.72 KB | hits: 25 | expires: Never
Find the WebView that Phonegap uses?
super.loadUrl("file:///android_asset/www/index.html");
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
View html = (View)super.appView.getParent();
Bitmap bm2 = Bitmap.createBitmap(200, 300, Bitmap.Config.ARGB_8888);
Canvas c2 = new Canvas(bm2);
html.draw(c2);
OutputStream stream = null;
try {
stream = new FileOutputStream(Environment.getExternalStorageDirectory() +"/bm2.png");
bm2.compress(CompressFormat.PNG, 80, stream);
if (stream != null) stream.close();
} catch (IOException e) {
} finally {
bm2.recycle();
}
}//end