Question

Is it possible to capture the graphics object created by the Google Earth browser plugin from a .NET WebBrowser control?

With this graphics object I could create an image to use as the background image for a panel that I can then draw on top of.

You cannot just use a WebBrowser control under a Panel control as the Google Earth plugin does not work.

Getting the browser graphics object just returns blank. The browser DrawToBitmap method (no intelisense) returns the web page but without the Google Earth image.

Any ideas?

Was it helpful?

Solution 3

After some more research and trial and error I am forced to admit defeat on this one, it seems imposible to show google earth on a panel when the webbrowser control hosing it is offscreen.

The solution is either to live with the limitation:

  • Set the form you wish to draw on background to transparent
  • Create a new form to be the parent of the drawing form
  • Display google earth on the new form
  • Align the forms correctly and allow the child to drive the parent

Or to switch to Microsoft Live Earth as there is already a proof of concept that works for WPF and winforms.

OTHER TIPS

Take a look at this project of mine: http://code.google.com/p/winforms-geplugin-control-library/ it will go some way to helping. The trick here is to capture the current image from the plugin as a bitmap and then use this (like double buffering).

Especially see the 'ScreenGrabButton_Click' method in 'GEToolStrip.cs' to see how to capture the image.

My apologies if I misunderstood the question - are you trying to display Google Earth in a Windows Forms program? If so, have a look at Google Earth COM API.

Google Earth COM API

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top