나는 nodej를 사용하는 창의 스크린 샷을 찍는 방법을 찾기위한 연구를하고 있는데, node-ffi를 사용하여이 작업을 수행하려고 시도하고 있지만 어떻게 멈춰야할지 모르겠다. 여기 :nodejs에서 창 스크린 샷을 찍으려면 어떻게해야합니까?
var ffi = require('ffi');
var user32 = new ffi.Library("user32", {
FindWindowA: [ 'uint32' , [ 'string', 'string' ]]
, PrintWindow: [ 'int32' , [ 'int32', 'string', 'int32' ]]
});
var IMG;
var windowHandle = user32.FindWindowA(null, "Calculator");
var printWin = user32.PrintWindow(windowHandle, IMG, 0);
console.log(printWin);
console.log(IMG);
결과 :
$ node get-print.js
1
undefined
++
내가 C에서 다음 작업 코드를 발견 편집을 할
Bitmap bm = new Bitmap(1024, 768);
Graphics g = Graphics.FromImage(bm);
IntPtr hdc = g.GetHdc();
Form1.PrintWindow(this.Handle, hdc, 0);
g.ReleaseHdc(hdc);
g.Flush();
g.Dispose();
this.pictureBox1.Image = bm;
이제 NodeJs에서이 작업을 수행해야합니다.
누구든지 도움을받을 수 있습니까?
어쩌면이 도와 드릴까요? http://stackoverflow.com/questions/20589097/how-to-capture-desktop-screen-of-computer-host-where-its-running-on-using-node – Acidic
프로젝트는 Windows 용이지만 ImageMagick과 같은 경우도 있습니다. 가져 오기는 대답 –