Overview: I would like to take a screenshot, turn it into a byte array and then upload it to a server. I'm using Xamarin.Forms for Visual Studio Mac.
The target device is an Android Emulator Tablet.
Tried a lot but I'm not that good in C#.
The piece of code I want to implement:
byte buffer = System.IO.File.ReadAllBytes("");
The code I want to implement it in:
public partial class MainPage : ContentPage
private async void DoPDFThings(object sender, EventArgs e)
var screenshot = await Screenshot.CaptureAsync();
await MediaGallery.SaveAsync(MediaFileType.Image, await screenshot.OpenReadAsync(), "myScreenshot.png");
What I have tried:
I have tried to paste it under my code but then I got multiple red underlines.