Пример #1
0
        public byte[] TakeScreenshot(Guid connectionId)
        {
            if (connectionId == Guid.Empty)
            {
                throw new ArgumentException(nameof(connectionId));
            }

            return(_captureService.TakeScreenshot(connectionId));
        }
Пример #2
0
        public HttpResponseMessage TakeScreenshot(Guid connectionId)
        {
            if (connectionId == Guid.Empty)
            {
                throw new ArgumentException(nameof(connectionId));
            }

            var result = new HttpResponseMessage(HttpStatusCode.OK);

            result.Content = new ByteArrayContent(_captureService.TakeScreenshot(connectionId));
            result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
            return(result);
        }