ArcGIS for Android 中MapView截图实现方法
来源:互联网 发布:下载gif软件 编辑:程序博客网 时间:2024/04/28 12:35
/**
* 把一个View的对象转换成bitmap
*/
private Bitmap getViewBitmap(MapView v) {
v.clearFocus();
v.setPressed(false);
//能画缓存就返回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);
// Restore the view
v.destroyDrawingCache();
v.setWillNotCacheDrawing(willNotCache);
v.setDrawingCacheBackgroundColor(color);
return bitmap;
}
* 把一个View的对象转换成bitmap
*/
private Bitmap getViewBitmap(MapView v) {
v.clearFocus();
v.setPressed(false);
//能画缓存就返回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);
// Restore the view
v.destroyDrawingCache();
v.setWillNotCacheDrawing(willNotCache);
v.setDrawingCacheBackgroundColor(color);
return bitmap;
}
- ArcGIS for Android 中MapView截图实现方法
- ArcGIS For Android MapView 截图
- ArcGIS for Android 中MapView的地图背景设置
- arcgis api for android MapView的索引
- arcgis for android 学习 - (4) 了解mapView的一些方法和事件
- ArcGIS for Android开发之MapView控件篇
- ArcGIS for Android开发之MapView控件篇
- arcgis for android sdk view层 mapview与scenneview
- ArcGIS for Android 地图控件 mapview 的常见操作
- 【Arcgis for android】Error inflating class com.esri.android.map.MapView【已解决】
- Arcgis for android Error inflating class com.esri.android.map.MapView
- ArcGIS for Android 1.1 MapView 的Activity退出时整个程序崩溃问题
- ArcGIS Runtime for Android开发教程V2.0(4)基础篇---MapView
- ArcGIS Runtime for Android开发教程V2.0(4)基础篇---MapView
- [ArcGIS for Android] arcgis runtime for android 中加载矢量数据的实现
- 【Arcgis for android】保存地图截图到sd卡
- Arcgis For Android实现比例尺
- ArcGIS API for iOS开发教程三 使用MapView
- Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
- 不要把大脑当做磁盘
- 继承、初始化及类的加载
- windows和ubuntu下的adb调试环境的搭建
- 日期取整年整月
- ArcGIS for Android 中MapView截图实现方法
- 窗口管理器
- 自己写的test测试
- for_each的用法,转载自蕭鴻森的blog
- linux-echo服务器
- Facebook移动广告表现远超桌面广告 投资者将重拾信心
- python初学常见问题记录(4.1)-解决了输出覆盖和提示不对应问题
- 6月18-22号-filelist
- 浅析tomcat nio 配置