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 this? Possibly with XPCOM or > js-ctypes?
You can use the drawWindow method of CanvasRenderingContext2D: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawWindow You just need to create a canvas element, call getContext('2d') on it, and then calculate the offset of the element you want to screenshot. -Ted _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform