I can't get image from Google Map with help of Drawing Cache in Android Studio -
i have code in layout:
<framelayout> <fragment ... android:name="com.google.android.gms.maps.supportmapfragment"> </fragment> </framelayout>
but when try use drawing cache, screenshot have zoom bar (with + , - buttons) , text "google" in left corner. use next code getting image:
view view = findviewbyid(r.id.frame); view.setwillnotcachedrawing(false); view.destroydrawingcache(); view.builddrawingcache(); view.setdrawingcacheenabled(true); routescreen = bitmap.createbitmap(view.getdrawingcache()); view.setdrawingcacheenabled(false);
the reason because map drawn using opengl , pixel data stored in gpu.
have @ google map's googlemap.snapshot() method in order capture screenshot of map.
Comments
Post a Comment