I am taking screenshot of Google Map v2 by using code of this answer which is giving me output :
Which is fine to take screen shot of Map
With following code i can take the screen shot of Layout with black map screen thats ok as with following code Map will black in ScreenShot
String mPath = Environment.getExternalStorageDirectory().toString()
+ "/" + "myTestScr" + System.currentTimeMillis() + ".jpeg";
Bitmap bitmap;
View v1 = (View) findViewById(R.id.rootviewtest);
v1.setDrawingCacheEnabled(true);
bitmap = Bitmap.createBitmap(v1.getDrawingCache());
v1.setDrawingCacheEnabled(false);
OutputStream fout = null;
File imageFile = new File(mPath);
try {
fout = new FileOutputStream(imageFile);
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, fout);
fout.flush();
fout.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
output of above code:
What I actually need is:
So, Now My question that how can get the output like in 3rd Screen programmatically
?
Help me to take one screen shot by merging both (1 and 2) screens programmatically
?
or any other alternate to merge both images programmatically
after taking both ( 1 and 2 ) screen shots ?