Capture a screenshot of Google Map Programmatically - c#

I need to take a screenshot of a Google Map without using a static map in asp.net.
The features I need are not in the static map API, including rotation of the map, traffic, and so on.
I've used several libraries, including the C# web browser, CEFSharp, but none of the ability to take screenshots from the Google map.
For example, my problem with the C# web browser is to load the Google map after the DocumentCompleted event.
The resulting image was displayed as gray content.
How can I get a screenshot of Google Map Programmatically?

Selenium works very well for browser automation in C#. Without knowing your use case not sure if launching a full chrome / Firefox instance will suffice however you can definitely use it launch the browser, navigate to the map, and screenshot.
How to screenshot in Selenium / C# has been nicely answered in another question here .

Related

How to open chrome and display as texture in game c# / unity

Ok, so my client wants a feature where the person should be able to find an image through google during their game. I'm not sure, the only idea I've had would be to basically screen record the specific application then apply it as a texture to a cube. It is also in VR so the Chrome searching has to be done specifically in application. Any suggestions?
you could do a screen capture kind of thing -
i stumbled upon a video when i was trying to get some embeded browser functionality going:
https://www.youtube.com/watch?v=lMLSACaaOjU
as the above shows you could take a capture based off of a certain click then whatever texture coding would come after that capture
also on the asset store there are assets which are costly that already contain embedded web browser depending on the platform.
https://assetstore.unity.com/packages/tools/gui/embedded-browser-55459
https://assetstore.unity.com/packages/tools/gui/3d-webview-for-android-137030
aside from that you would have to program the results returned from the google web search request made (unitywebrequest) and allow your client to select the image

Embed Youtube video in winforms webbrowser

I am trying to embed YouTube video in C# winforms webbrowser using this code:
webBrowser_q.Navigate("https://www.youtube.com/embed/OsHFxQSOkNU?autoplay=1&controls=0&enablejsapi=1&iv_load_policy=3&rel=0&showinfo=0&showsearch=0&start=0&end=0");
Unfortunately I get only black window instead of the video.
What am I doing wrong?
EDIT: I don't want to use AS3 player, because I want to use YouTube IFrame API.
You can find your answer here:
C# webbrowser Ajax call
According to this answer: "WebBrowser control (both WPF and WinForms versions) behaves in many ways differently from the full IE. You may want to implement Feature Control to bring its behavior as close to IE as possible (particularly, FEATURE_BROWSER_EMULATION)."
You can see the code sample that is given there. I was able to play a youtube video while before I saw a black screen and javascript errors.

Multiple browser screenshot with Selenium

I'm completely new to Selenium but I'm aware it's capable of taking browser screenshots. Though, I was wondering if it's able to take screenshots of multiple browsers, specifically chrome, firefox and IE.
Thanks
PS: I'm working with c#
While it is possible to take screenshots with Selenium for multiple browsers, there are some things that you might want to consider before choosing it as your implementation:
As emd mentioned, you will need to create a driver for each type of browser that you wish to take screenshots of as each has a different (internal) implementation for taking screenshots,
Currently the ChromeDriver is not capable of taking a full-screen screenshot (it will only take a screenshot of the current viewport, see here for more details),
Selenium is unable to take screenshots when a dialog box is present. If you are trying to take a screenshot of an unexpected dialog, this can be quite annoying.
As an alternative, you could implement a generic screenshot method in .Net. Have a look into Graphics.CopyFromScreen() method from System.Drawing. This implementation will be browser independent. See here for more details, or Google search some examples of its use for full screen screenshots =]

C# WPF WebBrowser Multi Touch

Hopefully someone can help, I'm having a few issues embedding a web browser into my application to display a Google maps page.
The page loads correctly in the IE Web browser and Awesomium, However we are actually using a Windows 7 touch screen and if I pinch zoom the Google Map the whole web browser zooms in. It doesn't seem to invoke the touch event on the Google Map.
If I browse to Google Maps via IE or Chrome the map support multi touch gestures, using the chrome.exe or ieexplorer.exe (not embedding in the application).
Is it possible to embed the same functionality into a WPF application?
GekoFX seems to support the touch events.
You may consider DotNetBrowser as an alternative. Its heavyweight mode provides support for touch events, and the Google Maps tutorial is available on C# Corner: http://www.c-sharpcorner.com/article/embed-google-maps-in-net-desktop-application/

Custom controlls and next and previous buttons for an embedded quicktime movie player

I'm currently working on a website project in asp.net that hosts videos in many different languages. They are in a series of 12 videos so I'd like to be able to embed one video player on the web page and then be able to click a next button and the next video in the list would play. I'd also like to be able to do the save thing with a previous button as well. Also is there a way to play and pause the video with custom controls? I did some research on it and I found some answers in Javascript but then I went to the apple documentation and it said you can no longer use it due to security reasons.
Does anyone have any solutions for any of these? Preferably in asp.net C# but anything will help. Thanks!
This should be doable using the code on apple's website. In fact, I just tried it using ordinary anchor hyperlinks to play and pause a movie. Works fine. Didn't try loading a new url, but it should work too. The security restriction only applies to calling javascript from a QuickTime movie. (Which btw can still be achived using an iframe).

Categories

Resources