don't execute the ESRI's command, just find out and write codes to zoom to the raster resolution. Here they are, I hope they will help.

Unfortunately (to you) I wrote these codes under C#. I hope you could manage the transfer these codes to VB. If not, feel free to contact me for further help. Because of this I'll write here some theory of mine too.

There are two possible way to solve this question. 
1. You want to run this under ArcMap (ArcCatalog) environment. 
2. You want to use this under your own MapControl and ToolBarControl with a raster (picture) where the Spatial Reference wasn't set.

My solutions: 
1. 
You can work with MxDoc and you have set up Spatial Reference for the Map. Therefore you can use the IRasterOutputSettings::RasterRatio method, which will give back the necessary ratio (number). 
In this case you can cast (QI in VB) to this interface from IDisplayTransformation. 
Finally the formula here to calculate the raster resolution is:

new map scale = old map scale / raster ratio.

See the code later.

2. 
If you use a raster or a picture (in my case it was a raster from a raster field directly) and the Spatial Reference wasn't set for the layer or a map the raster ratio will give back 1, and it isn't so useful in the previous dividing formula. In this case you have to query the size of the mapcontrol, the size of the raster layer and use them in this relation formula:

map control width / raster width = wanted map scale / known, FULL extent map scale.

(If you want to use this later then you have to store the very first or the necessary raster full extent's scale! In the sample code below I didn't do that.)

from this:

wanted map scale = map control width / raster width * known, FULL extent map scale.

I hope these will help.

And the (C#) code cores are... 

 
1.:
//get MxDocumnet, cast (QI in VB), under VBA you can use it instantly
IMxDocument mxDoc = m_app.Document as IMxDocument;
//get the ActiveView
IActiveView pActiveView = mxDoc.ActiveView; //get the DisplayTransformation
IDisplayTransformation pDisplayTransformation = pActiveView.ScreenDisplay.DisplayTransformation;
//the scale of the map (the IMap::MapScale is a shortcut to this method)
double mapScale = pDisplayTransformation.ScaleRatio; //get the RasterOutputSettings, with a cast (QI in VB) from IDisplayTransformation
IRasterOutputSettings pRasterOutputSettings = pDisplayTransformation as IRasterOutputSettings;
//raster ratio, see the help for discussion of the ratio number
double rasterRatio = pRasterOutputSettings.RasterRatio; //the formula for the raster resolution
pDisplayTransformation.ScaleRatio = (mapScale / rasterRatio) //refreshing the map
pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null); 2.:
//get the Map
IMap pMap = m_HookHelper.FocusMap;
//get the raster layer, with cast (QI in VB) from ILayer, in my map it was the layer at 0 index
IRasterLayer pRasterLayer = pMap.get_Layer( 0 ) as IRasterLayer; //width of the MapControl control on the form
int controlWidth = pMapControl.Width;
//because in the formula, you have to use the width as an explicitly converted double number in C#
double controlW = Convert.ToDouble( controlWidth ); //the formula for the raster resolution
pMap.MapScale = (controlW / pRasterLayer.ColumnCount * pMap.MapScale) //get the ActiveView
IActiveView pActiveView = m_HookHelper.ActiveView;
//refreshing the map
pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);

zoom to raster resolution的更多相关文章

  1. openlayers-热地图加载(完整版及代码)

    //地圖加載function mapInit(data){ //底图// var raster = new ol.layer.Tile({// source: new ol.source.Stamen ...

  2. 瓦片切图工具gdal2tiles.py改写为纯c++版本

    gdal2tiles.py是GDAL库中用于生成TMS瓦片的python代码,支持谷歌墨卡托EPSG:3857与经纬度EPSG:4326两种瓦片,输出png格式图像. gdal2tiles.py Mo ...

  3. 瓦片切图工具gdal2tiles.py改写为纯c++版本(二)

    python这么火,C++/C#的程序员都生存不下去了,为啥还要干把python转写成c++的这种反动的事? 项目需要呗... gdal2tiles.py文件中有两个类是计算全球墨卡托与WGS84两种 ...

  4. 巧用Openlayers4的Style

    原文:https://blog.csdn.net/gisshixisheng/article/details/80149087 概述 非常细化Openlayers4中的StyleFunction,因为 ...

  5. 完整版openlayer的例子及中文注释(完整中文版)

    //@sourceURL=PersonLocation.jsvar window_temp = { onbeforeunload: null, DEBUG_MODE: false, MAPLIST: ...

  6. Google Pixel 超分辨率--Super Resolution Zoom

    Google Pixel 超分辨率--Super Resolution Zoom Google 的Super Res Zoom技术,主要用于在zoom时增强画面细节以及提升在夜景下的效果. 文章的主要 ...

  7. yum install 安装 下载好的rpm包 会并依赖包一起安装 zoom电话会议的安装

    [root@ok-T Downloads]# rpm -ivh zoom_x86_64.rpm error: Failed dependencies: libxcb-image.so.()(64bit ...

  8. iphone dev 入门实例6:How To Use UIScrollView to Scroll and Zoom and Page

    http://www.raywenderlich.com/10518/how-to-use-uiscrollview-to-scroll-and-zoom-content Getting Starte ...

  9. RDCMan之DPI 和 Screen Resolution设置

    Customer要求在以下环境验证几个bug DPI setting Minimum   resolution 96 / 100% 1024x768 120 /125% 1280x960 144 / ...

随机推荐

  1. 【Conclusion】MySQL的安装和使用

    MySQL使用 因为数据库实验用到了MySQL,这里对现在已经涉及到的MySQL部分操作做一个简单的小结. 1.安装MySQL 上MySQL的官网下载对应自己OS平台的MySQL安装文件,有在线安装和 ...

  2. Android(java)学习笔记182:多媒体之撕衣服的案例

    1.撕衣服的案例逻辑:       是两者图片重叠在一起,上面我们看到的是美女穿衣服的图片,下面重叠(看不到的)是美女没有穿衣服的图片.当我们用手滑动画面,上面美女穿衣服的图片就会变成透明,这样的话下 ...

  3. centos7 系统安全加固方案

    一.密码长度与有效期 默认配置: [root@i-1y3we23j ~]# cat /etc/login.defs |grep PASS_ |grep -v '#' PASS_MAX_DAYS PAS ...

  4. 数据库sql语句limit区别

    注意:并非所有的数据库系统都支持 SELECT TOP 语句. MySQL 支持 LIMIT 语句来选取指定的条数数据, Oracle 可以使用 ROWNUM 来选取. SQL Server / MS ...

  5. 获取声音设备名称及PNPDeviceID

    实现效果: 知识运用: WMI管理类中的 ManagementObjectSearcher类 //基于指定的查询检索管理对象的集合 用于检索管理信息的较为常用的入口点之一 public Managem ...

  6. Promise 理解与使用

    个人觉得这篇博客写的非常详细且易懂,推荐给小伙伴们~ https://www.cnblogs.com/lvdabao/p/es6-promise-1.html#!comments

  7. ES6 export default 和 export 的区别

    export default 和 export 区别: 1.export与export default均可用于导出常量.函数.文件.模块等 2.你可以在其它文件或模块中通过import+(常量 | 函 ...

  8. No-10.高级变量类型

    高级变量类型 目标 列表 元组 字典 字符串 公共方法 变量高级 知识点回顾 Python 中数据类型可以分为 数字型 和 非数字型 数字型 整型 (int) 浮点型(float) 布尔型(bool) ...

  9. 文件默认权限umask掩码

    umask命令 作用:用于显示.设置文件的缺省权限 格式:umask   [-S] -S表示以rwx形式显示新建文件缺省权限 系统的默认掩码是0022 文件创建时的默认权限 = 0666 - umas ...

  10. 21. SCHEMATA

    21. SCHEMATA 在MySQL中,SCHEMA是数据库,因此SCHEMATA表提供有关数据库的信息. SCHEMATA表有以下列: CATALOG_NAME :SCHEMA所属目录的名称.该值 ...