Take screenshot in Xamarin.Forms

MohanrajMohanraj USMember ✭✭
edited April 2015 in Xamarin.Forms

Hi,

Can anyone come across how to take screenshot in Xamarin.Forms.

My need is to take screenshot of current screen and save it to device. Kindly suggest or share me some links/samples,it would help me lot.

Thanks in Advance.

Answers

  • MitchMilamMitchMilam USMember ✭✭✭

    @Mohanraj Greg Shackles wrote this article a while back.

  • NMackayNMackay GBInsider, University mod
  • FredyWengerFredyWenger CHInsider ✭✭✭✭✭

    @Mohanraj:
    You can take screenshots on iOS- and Android-devices by using special gestures.
    On iPad / iPhone that is:

    • Press and hold the master-button and then press the on/off-button (you the will hear a "click" like on a camera)
      On Android-Device this can varies depending on device:

    • Mostly you also have to configure that on the device (on my tablet it's a swipe gesture from left to right with the whole hand)
      On WP, I don't know...

    The images then are stored o the device.
    You have to copy them from the device to wherever you need it.
    On Android, this is relatively easy, as you can access the device directly over USB, on iOS you have to do more steps.
    First import the screenshot to the MAC and then to wherever you need it.
    On Android, you also can connect from VS (within the included Android-tools) to the device directly and take a screenshot (without debugging -> the device only have to be connected via USB).
    You will find details (and much more) in my starter-guide here:
    forums.xamarin.com/discussion/36821/quickstart-guide-to-start-developing-with-xamarin-forms#latest

    I take my screenshots:

    • on iOS from the iOS-simulator with screen-capture-tool SnagIt (medium quality)
    • on WP from the WP-simulator with screen-capture-tool SnagIt (medium-good quality)
    • on Android from the Android-tools in VS (good quality)
      For iOS and WP, I only would take screenshots directly from device, if I have to have the best quality (e.g. for printing some flyers or similar).

    So... I suggest you, to have a look to the starter-guide (link see above) and to make your screenshots like I do (as you can save a lot of time on this way).

    Hope this helps...

  • MohanrajMohanraj USMember ✭✭

    @MitchMilam Thanks for you suggestion. As we are working on Xamarin.Forms using C#. Could you please share the above suggested in C#.

  • MohanrajMohanraj USMember ✭✭

    @Fredywenger @NMackay Thanks for your suggestions. I have to capture app screen(like screenshots) and store within app memory like array in some formats such as bitmap, etc. Stored image will be viewed by using Image Control.

    Kindly give me your suggestions in Xamarin Forms using C# since we are developing apps with this .

  • FredyWengerFredyWenger CHInsider ✭✭✭✭✭

    @Mohanraj:
    I have misunderstood you (I thought, you want to create the screenshot out of the app).
    @dhindrik:
    I don't need screenshot-functionality right now in my app.
    But - your blog-post looks good (I will overtake it, when I need screenshots in my app).
    => Therefore - thanks and Like :smiley:

  • NMackayNMackay GBInsider, University mod

    @dhindrik

    Thanks for that blog post, really useful :smiley:

  • James.gomezJames.gomez NLMember
    edited October 2016

    I can't make screenshot of the google map in my android device using "http://danielhindrikes.se/xamarin/building-a-screenshotmanager-to-capture-the-screen-with-code/".
    But I can get rest of items screenshot at the top of google map.
    How can I get the screenshot of the google map in android?
    Please help me.
    I am looking for helping reply.
    Thanks.

  • Hi James,

    How could you able to take screenshots except google map. I am getting exception throw new Exception("You have to set ScreenshotManager.Activity in your Android project");.

    Please tell me how to set ScreenshotManager.Activity in your Android project.

    Your input is valuable for me.

  • drpatiencedrpatience USMember ✭✭

    @BissyVarghese Hey, did you solve the issue you mentioned ? Going through the same at the minute

  • drpatiencedrpatience USMember ✭✭

    @BissyVarghese Hi Bissy, did you solve the issue you mentioned ? I'm currently going through the same

  • drpatiencedrpatience USMember ✭✭

    @DanielHindrikes Can you take a screenshot when the back is a camera view as well ?

  • drpatiencedrpatience USMember ✭✭

    @DanielHindrikes Can you take a screenshot when the back is a camera view as well ?

  • VivekRajVivekRaj USMember

    @DanielHindrikes Can you take a screenshot when the back is a camera view as well ?

Sign In or Register to comment.