Capture HtmlViewer as image?

Does anybody here know how to capture the HtmlViewer as a image? I would like to remove the scrollbars too if that’s possible.

Thanks

This has been discussed a few times, without a really “good” solution (my opinion)…

What I would like to be able to do is capture the HTMLViewer image, but with the control itself NOT on the screen

To hide the scrollbars, you can just inject some CSS in the DocumentComplete event using the ExecuteJavascript method modify the DOM…

Dave, if you’re adventurous, you can always try PhantomJS

Thanks… but not what I want/need… I just want to be able to transfer the visual image of HTMLVIEWER into a CANVAS, and inside a XOJO app…

https://forum.xojo.com/8025-htmlviewer-image-to-canvas-question

I gather the scrollbars you refer to are on PC, since on Mac they pop up only during scroll. A simple way is to place the viewer onto a container control that is smaller than the size of it, so it hides the scrollbars when you put an instance on the window. It does not prevent using the mouse wheel to scroll, though. To do that would require JavaScript.

Yeah, PhantomJS can do screen captures and output to a file which you can then load in to a canvas
http://phantomjs.org/screen-capture.html

capture on what?
Platform: Mac? Win? Linux?
Target: Desktop? Web? Console? iOS?

I need to capture the image in Win7. Desktop

Thanks

In MBS Plugin we have HTMLViewer extensions for IE and WebKit for Windows.
maybe you want to check them.

[quote=156855:@Tim Adams]I need to capture the image in Win7. Desktop
[/quote]

This method works well :
https://forum.xojo.com/8025-htmlviewer-image-to-canvas-question?search=ControlSnapShot

Thanks Guys… I’ll check out the options you all mention.

Have a good weekend

I know this is ancient, but here’s my rewrite/update:
Should work with any arbitrary controls provided that their parent is a Window (vs another control) and is within the viewable area of the screen. Tested with HTMLViewer (in WebKit mode too) on Windows 10, Ubuntu 16.04, and macOS Sierra.

https://github.com/Steveorevo/ControlSnapshot

[quote=301253:@Stephen Carroll]I know this is ancient, but here’s my rewrite/update:
Should work with any arbitrary controls provided that their parent is a Window (vs another control) and is within the viewable area of the screen. Tested with HTMLViewer (in WebKit mode too) on Windows 10, Ubuntu 16.04, and macOS Sierra.
https://github.com/Steveorevo/ControlSnapshot[/quote]

Thanks, Stephen - I’ve not tested your solution but had terrible trouble with screenshotting HTMLViewers in some cases: e.g. when they are playing Flash (SWF) plugin content or HTML5 video. It’s probably impossible to make it work if the Video is DRM’d.

Does yours work in any of those situations?