private Bitmap getViewBitmap(MapView v) {
v.clearFocus();
v.setPressed(false);
boolean willNotCache = v.willNotCacheDrawing();
v.setWillNotCacheDrawing(false);
int color = v.getDrawingCacheBackgroundColor();
v.setDrawingCacheBackgroundColor(0);
if (color != 0) {
v.destroyDrawingCache();
}
v.buildDrawingCache();
Bitmap cacheBitmap = null;
while (cacheBitmap == null) {
cacheBitmap = v.getDrawingMapCache(0, 0, v.getWidth(),
v.getHeight());
}
Bitmap bitmap = Bitmap.createBitmap(cacheBitmap);
v.destroyDrawingCache();
v.setWillNotCacheDrawing(willNotCache);
v.setDrawingCacheBackgroundColor(color);
return bitmap;
}
ArcGIS For Android MapView 截图
最新推荐文章于 2024-01-25 23:00:00 发布