I want to capture GoogleMap screen shot
GoogleMap.Snapshot is another way to accomplish that but That is written in Java which I don't know how to convert.
https://stackoverflow.com/questions/13773658/capture-screen-shot-of-googlemap-android-api-v2/18093295#18093295
Answers
Yeah you can take the screen shot in xamarin forms quite easily.
You don't even need a full Java or Swift code to make this possible in xamarin forms.
All you need is just install the plugin i.e., Xam.Plugin.ScreenShot and this will do everything for you.
Let me share a documentation link of this Nuget Package.
https://github.com/wilsonvargas/ScreenshotPlugin
My Xamarin solution seemed to be stable and working well and it shows the map fragment and everything is functional about the maps. I used the form button event to trigger the plug-in capture. I save it to local storage and I can see the file and I can open up the jpeg only that is black. I'm not sure where I'm going wrong in plug-in implementation.
visit below link
https://xamarinhelp.com/taking-a-screenshot-in-xamarin-forms/
This is a second post on taking ScreenShot. The first one was posted because I tried what @SachinBali
recommended without success. See my post
https://forums.xamarin.com/discussion/comment/393297#Comment_393297
Question:
If you take a screenshot using the OS built-in screenshot feature... Home+Power or whatever it is your your device/OS... Is the map fragment still obfuscated? I never seem to have an issue taking screenshot that have Google Maps so I don't think they're doing anything fancy to protect their proprietary information: But could be.
Terrific. So the component/fragment isn't blocking it in some way.
Have you tried a basic app (not your full app) with a very simple page and the map fragment to see if that works - using the methods already suggested or that you've found through your research? If that works but your app doesn't, its another step closer.
If that doesn't work either please post your capture code and maybe a link to a public repo others can download and look at to see if something jumps out.
In my other thread
https://forums.xamarin.com/discussion/comment/393297#Comment_393297
I posted a solution that is failing with capturing Mapfragment. If you want me to post code for that then please let's pickup on that thread... I want to keep these threads separated ... Thanks in advance.
I'm now lost. What is the actual problem:
1 - That you need to know how to use that button combination to trigger the capture
or
2 - That your capture doesn't contain the map fragment
And/Or
2) How to programmatically capture Google Map screenshot using XamarinHelp or Xam.Plugin article which I have posted in the second thread.
Hopefully this will clear the confusion.
I'll make another effort to explain why we, the readers, are confused.
You're talking about two different things there and not telling us where you're lost.
In other words you're talking about both the trigger and the response to the trigger and we don't know which half of this is a problem.
Or is it "C: All the above"?
Do you not know how to do either part of that?
Clearly we're miscommunicating about what part of your question is where you're having problems.
Maybe someone else here can find a different way to ask the question.
I am sorry that I Have caused you so much confusion.
Lets try one more time try to focus on hardware buttons only. Lets say I have an app with GoogleMap Fragment. Lets say I am showing a pin at a location.
Now if I wanted to capture The screen shot of the map and pin I simply hold down the Power button along with VolumeDown button simultaneously. This results in a screen capture that is save in the ScreenCapture Folder.
Now supposing if I wanted to do exactly that using the code to simulate the pressing of those two buttons. What would that code would look like. Can you please share that code with the community.
Hope this clarifies things.