node-rdpjs icon indicating copy to clipboard operation
node-rdpjs copied to clipboard

How do I save a screenshot of the returned bitmap file ?

Open Mylab6 opened this issue 10 years ago • 3 comments

I've been working with this for a solid 4 hours, and I can not figure it out.

The best I can do is an array of the pixel values .

Mylab6 avatar Feb 03 '16 07:02 Mylab6

Did you figure this out? I can do it on the client-side pretty easily with canvas.toDataUrl(), but I want it on the server-side on mouse isPressed = true.

Mikej81 avatar Sep 28 '17 16:09 Mikej81

@Mikej81 @Mylab6 Here's a gist that shows how I've done it. https://gist.github.com/FabledWeb/8253b74ad3f26778aadfb063f19a6a46

The idea is to create a buffer image the size of the screen, then as you get back bitmaps (they are bitmaps of a part of the screen), write that to the buffer image at the correct location.

Then whenever you need to see the screen (on some interval or based on some other code), write that to disk.

EddieCanales avatar Oct 10 '17 21:10 EddieCanales

Nice! I'll try this out as soon as I can. This is how I'm doing it on each mouseclick now, not ideal, but its working: https://github.com/Mikej81/WebRDP/blob/master/socket/index.js#L53

Mikej81 avatar Oct 11 '17 15:10 Mikej81