Automobile.Mobile.iOS.Automation.iOSDevice.TakeScreenshot C# (CSharp) Method

TakeScreenshot() public method

Takes the screenshot.
public TakeScreenshot ( ) : byte[]
return byte[]
        public override byte[] TakeScreenshot()
        {
            UIGraphics.BeginImageContext(WebView.Bounds.Size);
            var ctx = UIGraphics.GetCurrentContext();

            WebView.Layer.RenderInContext(ctx);
            var img = UIGraphics.GetImageFromCurrentImageContext();
            UIGraphics.EndImageContext();

            return img.AsPNG().ToArray();
        }