Take snapshot of map

iisue

Capture screen shot of GoogleMap Android API V2

How to get Bitmap of MapView from Android Google Maps API V2

http://46424.com/question/119446#.URIJAr-cepg

possible solutions

Taking screenshot of Android OpenGL

http://developer.android.com/guide/topics/graphics/opengl.html

http://developer.android.com/guide/topics/media/camera.html#manifest

otheres

Hiding and Showing on screen Markers with Google Maps Android API V2

http://wptrafficanalyzer.in/blog/google-maps-in-android-application-with-new-google-maps-android-api-v2-using-supportmapfragment/

OPen the intent of camera

private void takeSnapshot2() {
// create Intent to take a picture and return control to the calling application
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

// fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create a file to save the image
File imageFile = new File(Environment.getExternalStorageDirectory() + “/test3.png”);
intent.putExtra(MediaStore.EXTRA_OUTPUT, imageFile); // set the image file name

// start the image capture Intent
startActivityForResult(intent, 100);

}

 

Taking snapshot of screen

LinearLayout mLayoutRoot = (LinearLayout) findViewById(R.id.parent);
mLayoutRoot.setDrawingCacheEnabled(true); //mLayoutRoot is your Parent Layout(may be RelativeLayout, LinearLayout or etc..)
mLayoutRoot.buildDrawingCache();

Bitmap mBitmap= mLayoutRoot.getDrawingCache();
try {
if(mBitmap!=null)
{
FileOutputStream out = new FileOutputStream(Environment.getExternalStorageDirectory() + “/test.png”);
mBitmap.compress(Bitmap.CompressFormat.PNG, 90, out);
out.flush();
out.close();
Toast.makeText(this, “snapshot taken”, Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {}

6 Ways To Take Screenshots On Android

SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.basicMap);

    View v1 = mapFragment.getView();
Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s