Re: Taking screenshots of single elements (XUL/XULRunner)

2016-01-20 Thread M . Bauermeister
I'm not sure what exactly I'm doing wrong but neither drawWindow, nor asyncDrawXULElement seem to work for me. Not even for screenshots of the whole window. "Borrowing" from capture.js/screenshot.js also made me none the wiser. Is there something wrong with how I'm trying to copy the contents

Re: Taking screenshots of single elements (XUL/XULRunner)

2016-01-20 Thread Patrick Brosset
Hm, could this be related to e10s? I remember we had to do some work to make the devtools screenshot command e10s-compatible. Now it runs in the content process, whereas before it would run in the parent process. Trying to take a screenshot from the parent process with e10s enabled would end up

Re: Taking screenshots of single elements (XUL/XULRunner)

2016-01-20 Thread M . Bauermeister
Spot on, Boris! Not sure why I never tried wrapping it into a function call :head->wall: Thanks for the help! ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform

Re: Taking screenshots of single elements (XUL/XULRunner)

2016-01-20 Thread M . Bauermeister
One more thing. Is there a way to take screenshots of XUL panels with the above technique, as well? Since they're not part of the window's DOM they obviously don't show up on the canvas either. ___ dev-platform mailing list

Re: Taking screenshots of single elements (XUL/XULRunner)

2016-01-20 Thread Boris Zbarsky
On 1/20/16 4:50 AM, m.bauermeis...@sto.com wrote: Is there something wrong with how I'm trying to copy the contents of the window to the canvas? Try doing it after the load event fires? XUL doesn't start layout until the whole document is parsed, iirc, but your script is running before

Re: Taking screenshots of single elements (XUL/XULRunner)

2016-01-19 Thread M . Bauermeister
In case my OP isn't clear enough. I'm basically looking for the XUL counterpart to WPF's/XAML's RenderTargetBitmap, which enables the developer to render a selected UIElement to a Pixelbuffer and save it as png, with full alpha blending support. ___

Re: Taking screenshots of single elements (XUL/XULRunner)

2016-01-19 Thread Ted Mielczarek
On Tue, Jan 19, 2016, at 01:39 AM, m.bauermeis...@sto.com wrote: > As part of my work on a prototyping suite I'd like to take screenshots > (preferably retaining the alpha channel) of single UI elements. I'd like > to do so on an onclick event. > > Is there a straightforward way to accomplish

Re: Taking screenshots of single elements (XUL/XULRunner)

2016-01-19 Thread Patrick Brosset
Which is also what DevTools does: https://dxr.mozilla.org/mozilla-central/source/devtools/shared/gcli/commands/screenshot.js#260 On Tue, Jan 19, 2016 at 1:03 PM, Andreas Tolfsen wrote: > On 19 January 2016 at 11:22, Ted Mielczarek wrote: > > On Tue, Jan

Re: Taking screenshots of single elements (XUL/XULRunner)

2016-01-19 Thread M . Bauermeister
Thanks for the pointers. I've decided to try the basics first, rendering the whole window to the canvas. Unfortunately, the result, as of yet, is an empty canvas with a white background. Anything I'm missing here? http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul;

Re: Taking screenshots of single elements (XUL/XULRunner)

2016-01-19 Thread David Burns
You can try getting access to https://dxr.mozilla.org/mozilla-central/source/testing/marionette/capture.js and then that will give you everything you want or you can just "borrow" the code from there. David On 19 January 2016 at 11:22, Ted Mielczarek wrote: > On Tue, Jan

Taking screenshots of single elements (XUL/XULRunner)

2016-01-18 Thread M . Bauermeister
As part of my work on a prototyping suite I'd like to take screenshots (preferably retaining the alpha channel) of single UI elements. I'd like to do so on an onclick event. Is there a straightforward way to accomplish this? Possibly with XPCOM or js-ctypes?