Snapshot from the map in android -
Snapshot from the map in android -
i want create snapshot of particular location map calling intent or mapview.can help me.i not getting snapshot.
try this post, believe should help. involves enabling drawing cache , forcing utilize cache. works on views. should work on mapview
aswell
code link
private bitmap getmapimage() { /* position map output */ mapcontroller mc = mapview.getcontroller(); mc.setcenter(some_point); mc.setzoom(16); /* capture drawing cache bitmap */ mapview.setdrawingcacheenabled(true); bitmap bmp = bitmap.createbitmap(mapview.getdrawingcache()); mapview.setdrawingcacheenabled(false); homecoming bmp; } private void savemapimage() { string filename = "foo.png"; file f = new file(getexternalfilesdir(null), filename); fileoutputstream out = new fileoutputstream(f); bitmap bmp = getmapimage(); bmp.compress(bitmap.compressformat.png, 100, out); out.close(); }
android maps location snapshot
Comments
Post a Comment