C# 调用 Google Earth Com API开发(三)
2009-05-22 08:29:45 来源:WEB开发网双击事件:
1: /// <summary>
2: /// 鼠标钩子。鼠标双击事件
3: /// </summary>
4: /// <param name="sender"></param>
5: /// <param name="e"></param>
6: void mouseHook_MouseDbClick(object sender, MouseEventArgs e)
7: {
8: IntPtr hWnd = NativeMethods.WindowFromPoint(e.Location);
9: if (hWnd == this.GeRenderHWnd)
10: {
11: Point point = this.Control.PointToClient(e.Location);
12: // 如果鼠标击点位置在控件内部,则说明鼠标点击了GoogleEarth视图
13: if (this.Control.ClientRectangle.Contains(point))
14: {
15: Console.WriteLine("xx双击了GoogleEarth...");
16:
17: DoublePoint dp = ((GERenderPanel)Control).DetermineScreenCoordinates(point.X, point.Y);
18:
19: ParameterizedThreadStart pts = new ParameterizedThreadStart(ShowMouseDbClickPoint);
20:
21: Thread thread = new Thread(pts);
22: thread.Start(dp);
23:
24: }
25: }
26: }
27:
28: protected void ShowMouseDbClickPoint(object obj)
29: {
30: //Thread.Sleep(20);
31: DoublePoint dp = (DoublePoint)obj;
32: PointOnTerrainGE pGe = GeApp.GetPointOnTerrainFromScreenCoords(dp.X, dp.Y);
33: Console.WriteLine("xx鼠标双击了:Lnt=" + pGe.Longitude.ToString()
34: + ";Lat=" + pGe.Latitude.ToString());
35:
36: MessageBox.Show("我还是出来一下吧!省得你不知道你已经双击了鼠标!");
37: }
- ››Google运作经理Bryan Power给出的GOOGLE求职意见
- ››Google用户体验的十大设计原则
- ››Google Analytics(分析)能为网站带来什么
- ››Google goggles图片搜索 如何优化一个wap网站
- ››Google Docs将增加iPhone和Android编辑功能
- ››Google Android操作系统内核编译图文教程
- ››google map api 与jquery结合使用--控件,监听器...
- ››google map api 与jquery结合使用(2) --标注,浮...
- ››google map api 与jquery结合使用(3) --图标样式...
- ››Google 首页代码分析及简评
- ››Google财经更新iPhone和Android版本
- ››Google否认Android应用认证体系被破解
赞助商链接