Automobile.Mobile.iOS.Automation.iOSDevice.TakeScreenshot C# (CSharp) 메소드

TakeScreenshot() 공개 메소드

Takes the screenshot.
public TakeScreenshot ( ) : byte[]
리턴 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();
        }