screenshot

html2canvas basics

强颜欢笑 提交于 2020-02-20 06:17:00
问题 <html> <head> <title>test</title> <script src="external/jquery-1.6.2.js"></script> <script type="text/javascript" src="js/html2canvas.js"></script> <script type="text/javascript"> $(document).ready(function() { $('body').html2canvas(); var queue = html2canvas.Parse(); var canvas = html2canvas.Renderer(queue,{elements:{length:1}}); var img = canvas.toDataURL() window.open(img); }); </script> </head> <body> <h1>Testing</h1> <img src='http://localhost:8080/test/images/1.jpg'> </body> </html>

Creating an HTML report with embedded screenshots of failed JUnit tests

时光怂恿深爱的人放手 提交于 2020-02-04 04:49:31
问题 I've put together a custom JUnit runner that saves a screenshot when a WebDriver test fails. I'm using Maven's failsafe plugin to create reports of the integration tests and TeamCity is our CI server. I know TeamCity supports custom reports, but I don't know how I'd embed the image files into an HTML page (or pages) with references to the relevant tests. What would be a good method to integrate the screenshots into the test report? Is there a Maven plugin that'll do the job? 回答1: Maybe Allure

Delphi desktop screenshot in Windows10, issue with GetDeviceCaps

北城以北 提交于 2020-01-29 08:45:25
问题 How can I get the correct screen size to take a screenshot in Windows10? it seems to get incorrect values (maybe DPI issue?) i.e // screenshot b := TBitmap.Create; DC := GetDC(GetDesktopWindow); try b.Width := GetDeviceCaps (DC, HORZRES) ; b.Height := GetDeviceCaps (DC, VERTRES) ; BitBlt(b.Canvas.Handle, 0, 0, b.Width, b.Height, DC, 0, 0, SRCCOPY) ; finally ReleaseDC (GetDesktopWindow, DC) ; end; on a 4K screen will only capture a small portion on the upper left corner. 回答1: You need to make

iOS Detection of Screenshot?

青春壹個敷衍的年華 提交于 2020-01-26 05:44:33
问题 The app Snapchat, on the App Store, is an app that lets you share pictures with a self-destruct on them. You can only view the pics for X seconds. If you attempt to take a screenshot while the picture is showing using the home-power key combo, it will tell the sender you tried to take a screenshot. What part of the SDK lets you detect that the user is taking a screenshot? I did not know this was possible. 回答1: I found the answer!! Taking a screenshot interrupts any touches that are on the

Not capturing screenshots with Selenium Grid

末鹿安然 提交于 2020-01-26 03:53:06
问题 When the assertion fails it doesn't capture the screenshots. I am running Selenium Grid with Windows as Hub, 1 Windows as Node, and 1 Mac as Node. 回答1: You don't need to use Augmenter anymore as RemoteWebDriver now implements TakesScreenshot interface , Have a look here for RemoteWebDriver 来源: https://stackoverflow.com/questions/38195311/not-capturing-screenshots-with-selenium-grid

How can I create thumbnail from WPF window and convert it into bytes[] so I can persist it?

允我心安 提交于 2020-01-24 22:05:46
问题 I would like to create Thumbnail from my wpf window and would like to save it into database and display it later. Is there any good solution? I have started with RenderTargetBitmap but I can't find any easy way to get it into bytes. RenderTargetBitmap bmp = new RenderTargetBitmap(180, 180, 96, 96, PixelFormats.Pbgra32); bmp.Render(myWpfWindow); Using user32.dll and Graphics.CopyFromScreen() is not good for me and as it is here because I want to do a screenshot from user controls as well.

How can I create thumbnail from WPF window and convert it into bytes[] so I can persist it?

有些话、适合烂在心里 提交于 2020-01-24 22:05:04
问题 I would like to create Thumbnail from my wpf window and would like to save it into database and display it later. Is there any good solution? I have started with RenderTargetBitmap but I can't find any easy way to get it into bytes. RenderTargetBitmap bmp = new RenderTargetBitmap(180, 180, 96, 96, PixelFormats.Pbgra32); bmp.Render(myWpfWindow); Using user32.dll and Graphics.CopyFromScreen() is not good for me and as it is here because I want to do a screenshot from user controls as well.

Capturing a desktop screenshot with javascript

喜夏-厌秋 提交于 2020-01-24 04:16:25
问题 Is it possible to capture a screenshot of the client's windows desktop using javascript? What about in linux and mac OS? Clarification This question has not been asked or answered, because I'm looking to capture the entire desktop, not just the browser. I would also like to capture 'native' screenshot rather than one that is recreated from some underlying representation (which would be impossible on any OS). 回答1: Exist a plugin that you can configure the image that you want to take or part of

Make screenshot of DirectX window that is hidden and doesn't have focus

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-23 17:44:06
问题 How to grab a screenshot of a DirectX window that is not in foreground and doesn't have focus. I want to monitor what happens with application in the background, but without switching to it. The standard way with PrintWindow doesn't work. You can test that on Unity apps, for example. 来源: https://stackoverflow.com/questions/30694056/make-screenshot-of-directx-window-that-is-hidden-and-doesnt-have-focus

three.js toDataURL PNG is black

不打扰是莪最后的温柔 提交于 2020-01-23 17:40:06
问题 I'm trying to grab a screenshot with renderer.domElement.toDataURL("image/png"), and save it to a file. The image is the right size, but it's black. I have preserveDrawingBuffer turned on. I think I'm decoding and saving the file correctly, because when I hexdump it I can see the correct initial characters for the PNG format, as well as the IHDR and IDAT chunk headers. However the closing IEND is missing. Any known issues here? Hints? Windows 7/Firefox up to date if it matters. Thanks...