要为SceneControl设置鼠标滚轮缩放必须定义委托,因为SceneControl没有Wheel事件,所以委托From的Wheel事件

 public Form1()
{
InitializeComponent();
this.MouseWheel += new MouseEventHandler(this.SceneControl_MouseWheel); //在这个地方输入"this.MouseWheel+=”后连续按两次Tab键
}
private void SceneControl_MouseWheel(object sender, System.Windows.Forms.MouseEventArgs e)
{
try
{
axSceneControl1.MousePointer = esriControlsMousePointer.esriPointerZoom;
System.Drawing.Point pSceneLocation = axSceneControl1.PointToScreen(axSceneControl1.Location);
System.Drawing.Point Pt = axSceneControl1.PointToScreen(e.Location);
if (Pt.X < pSceneLocation.X | Pt.X > pSceneLocation.X + axSceneControl1.Width | Pt.Y < pSceneLocation.Y | Pt.Y > pSceneLocation.Y + axSceneControl1.Height)
return;
double scale = 0.2;
if (e.Delta < ) scale = -0.2;
ICamera pCamera = axSceneControl1.Camera;
IPoint pObserver = pCamera.Observer;
IPoint pTarget = pCamera.Target;
pObserver.X += (pObserver.X - pTarget.X) * scale;
pObserver.Y += (pObserver.Y - pTarget.Y) * scale;
pObserver.Z += (pObserver.Z - pTarget.Z) * scale;
pCamera.Observer = pObserver;
axSceneControl1.SceneGraph.RefreshViewers();
//this.Text = e.Delta.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

SceneControl+AE+鼠标滚轮缩放的更多相关文章

  1. js 禁止用户使用Ctrl+鼠标滚轮缩放网页

    为什么会有人会使用ctrl+鼠标滚轮缩放网页?坚决禁止! <html> <head> <title>测试</title> <script lang ...

  2. Engine中如何实现鼠标滚轮缩放反置?

    来自:http://zhihu.esrichina.com.cn/?/question/6666 [解决办法]:1,禁用IMapControl的默认鼠标滚轮事件.即设置IMapControl4.Aut ...

  3. PCB Genesis 鼠标滚轮缩放与TGZ拖放 插件实现

    一.背景: 做过CAM的人都用过Geneiss软件,由于处理资料强大,目前奥宝公司出品的Genesis占领整个PCB行业,整个行业无人不知呀, 而此软件有一个吐槽点Genesis 无滚轮缩放与TGZ拖 ...

  4. Winform中设置ZedGraph鼠标滚轮缩放的灵敏度以及设置滚轮缩放的方式(鼠标焦点为中心还是图形中心点)

    场景 Winforn中设置ZedGraph曲线图的属性.坐标轴属性.刻度属性: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/10 ...

  5. Magnifier.js - 支持鼠标滚轮缩放的图片放大镜效果

    Magnifier.js 是一个 JavaScript 库,能够帮助你在图像上实现放大镜效果,支持使用鼠标滚轮放大/缩小功能.放大的图像可以显示在镜头本身或它的外部容器中.Magnifier.js 使 ...

  6. 关于 WebBrowser调用百度地图API 鼠标滚轮缩放地图级别失灵的解决办法

    在桌面程序下 百度地图API的鼠标缩放地图功能可能会失灵无效! 这个原因不是API的问题 小弟试了下在WEB上面是没有问题的 于是考虑可能是WebBrowser的获取焦点问题,于是在主窗体 添加了一个 ...

  7. Qt无边框窗口的移动、拉伸边框、鼠标滚轮缩放大小

    主要是处理窗口上鼠标的几个事件,具体代码请看下面的截图, 完整代码的下载链接在此:http://download.csdn.net/detail/beyond0824/9657110, 本示例代码中, ...

  8. 【three.js练习程序】鼠标滚轮缩放

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  9. echarts数据区域缩放(鼠标滚轮、滚动条、拉选框)

    当一个echarts图表上的数据很多时,想要查看部分区域的数据状态,可以通过数据区域缩放来实现,现总结三个方法: 鼠标滚轮缩放: var arr = []; for(var i = 0;i<15 ...

随机推荐

  1. vscode 习惯配置

    { "gitlens.advanced.messages": { "suppressShowKeyBindingsNotice": true }, " ...

  2. ntohs, ntohl, htons,htonl的比较和详解【转】

    ntohs =net to host short int 16位 htons=host to net short int 16位 ntohs =net to host long int 32位 hto ...

  3. Get与Post提交方式的区别

    用 curl 测试 post 请求: curl -d   "agentCode=RB&startDate=2017-07-01&endDate=2017-09-01& ...

  4. Eclipse中Ctrl+Shift+f快捷键无效的解决方式

    某天突然发现idea非常重要的快捷键ctrl+shift+f无效了,网上搜了很多都说是qq快捷键冲突,但是找了下qq快捷键却没有解决,现在给大家一个解决快捷键冲突的思路: 1.查看QQ快捷键--> ...

  5. Haskell语言学习笔记(45)Profunctor

    Profunctor class Profunctor p where dimap :: (a -> b) -> (c -> d) -> p b c -> p a d d ...

  6. Game2048

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  7. Validate the date format

    Validate the date format function checkdate(input) { var validformat = /^\d{2}\/\d{2}\/\d{4}$/; //Ba ...

  8. 可能空字符串转换为浮点型或者整数型:java.lang.NumberFormatException: For input string: " "

    Integer.valueOf(str.equals("")?"0":str)

  9. 破解版ps

    http://www.sdifen.com/adobe-photoshop-cc.html

  10. Codeforces Beta Round #12 (Div 2 Only)

    Codeforces Beta Round #12 (Div 2 Only) http://codeforces.com/contest/12 A 水题 #include<bits/stdc++ ...