C # calls Google Earth Com API Development (D)

Source: Internet
Author: User

This article continues to introduce the basics of Google Earth COM API development, as compared to the third article:

1 increase the mouse wheel support, you can zoom in, zoom out. This feature utilizes the HookAPI.dll provided in the previous article to implement

2 Read Placemarks (location in Google Earth interface) and show, hide

3 Read all layers, show and hide

Next, continue to put the code:

1, mouse wheel event, to achieve magnification, reduce

1: ...
2://Zoom
3:private Const Long zoomin = 0x00780000
4://Zoom Out
5:private const long zoomout = 0xff880000;< br> 6: ...
7:mousehook.mousewheel + = new MouseEventHandler (Mousehook_mousewheel);
8:.
9:///<summary>
10:///mouse Hook. Mouse scrolling Event
One:///</summary>
:///<param name= "sender" ></PARAM>
:///<param name= "E" & Gt;</param>
14:void Mousehook_mousewheel (object sender, MouseEventArgs e)
: {
16:intptr hWnd = Nat Ivemethods.windowfrompoint (e.location);
17:if (HWnd = = this. Gerenderhwnd)
: {
19:point point = this. Control.pointtoclient (e.location);
20://If the mouse position is inside the control, the mouse is scrolled in the range of the GoogleEarth view
21:if (this. Control.ClientRectangle.Contains (point)
: {
23:nativemethods.postmessage (gerenderhwnd, (int) wm_mous E.wm_mousewheel, E.delta = 120? Zoomin:zoomout, 0);
24:}
25:}
:}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.