C# 调用 Google Earth Com API开发(三)
2009-05-22 08:29:45 来源:WEB开发网好久没有更新《C#调用Google Earth Com API开发》系列文章了,今天带给大家的是第三篇,本篇相对于第二篇主要改进了三个方面。
1) 实现GoogleEarth显示画面随窗口大小改变而改变
2) 截获GoogleEarth鼠标消息,实现单击、双击功能;鼠标滚轮缩放现在只能放大!O(∩_∩)O~
3) 实现GoogleEarth彩色截图(测试环境:Windows 2003 Server ,Vista与Win7中不可用,XP未测)
下面还是继续看代码:
1、GoogleEarth动态改变大小
1: /// <summary>
2: /// 重新改变GoogleEarth视图的大小
3: /// </summary>
4: private void ResizeGoogleControl()
5: {
6: NativeMethods.SendMessage(GEHWnd, (uint)NativeMethods.WM_COMMAND, NativeMethods.WM_PAINT, 0);
7: NativeMethods.PostMessage(GEHWnd, NativeMethods.WM_QT_PAINT, 0, 0);
8:
9: RECT mainRect = new RECT();
10: NativeMethods.GetWindowRect(GEHWnd, out mainRect);
11: clientRect = new RECT();
12: NativeMethods.GetClientRect(GEHrender, out clientRect);
13:
14: int offsetW = mainRect.Width - clientRect.Width;
15: int offsetH = mainRect.Height - clientRect.Height;
16:
17: int newWidth = this.Control.Width + (int)offsetW;
18: int newHeight = this.Control.Height + (int)offsetH;
19:
20: NativeMethods.SetWindowPos(GEHWnd, NativeMethods.HWND_TOP,
21: 0, 0, newWidth, newHeight,
22: NativeMethods.SWP_FRAMECHANGED);
23:
24: NativeMethods.SendMessage(GEHWnd, (uint)NativeMethods.WM_COMMAND, NativeMethods.WM_SIZE, 0);
25: }
- ››Google搜索引擎的奥秘
- ››Google测试搜索结果页面右侧内容更丰富的信息栏
- ››调用已注册会员人数和最新会员名称
- ››Google Dart精粹:应用构建,快照和隔离体
- ››google的代码审查
- ››google analytics清晰追踪爬虫的爬行信息
- ››Google+中文用户在两千万Google+大军中是少数派
- ››Google AdWords最昂贵点击成本的20种关键词分类
- ››Google运作经理Bryan Power给出的GOOGLE求职意见
- ››Google用户体验的十大设计原则
- ››Google Analytics(分析)能为网站带来什么
- ››Google goggles图片搜索 如何优化一个wap网站
赞助商链接