Hi,
I attempted to capture a partial screenshot using makeScreenshot plugin.
This is some code
Code
function run(x, y)
{
const data = krpano.webGL.makeScreenshot(
120, 80, false, "png", 1, {x: x, y: y, w: 120, h: 80}
);
console.log("data:", data);
}
And in xml, I call it:
Code
<plugin name="screenshotPlugin" url="/static/krpano/plugins/screenshot.js" keep="true"/>
<action name="getHot">
screentosphere(mouse.x, mouse.y, toh, tov);
global.plugin[screenshotPlugin].make(get(toh), get(tov));
</action>
<events name="localEvents" ondoubleclick="getHot();" />
I expect to capture a screenshot of the mouse click position with a size of 120 * 80, but I get a thumbnail of the entire window instead.
What could be wrong with my approach?
Thank you!