G
gnq
Unregistered / Unconfirmed
GUEST, unregistred user!
我用TClientSocket和TServerSocket做了一个远程抓屏的程序。
可是发现,当一端抓屏的时候,CPU资源一下子升高了,如果连续抓屏,就会影响正常使用电脑。其中关键抓屏代码:
var
image:Tbitmap;
jpgstream:Tjpegimage;
SCanvas:TCanvas;
memoryStream:TMemoryStream;
............
SCanvas:=TCanvas.Create;
SCanvas.Handle:=getDC(0);
image:=Tbitmap.Create;
image.Width:=Screen.Width;
image.Height:=Screen.Height;
image.Canvas.CopyRect(rect(0,0,screen.Width,screen.Height),Scanvas,rect(0,0,screen.Width,screen.Height));
jpgstream:=Tjpegimage.Create;
jpgstream.Assign(image);
jpgstream.CompressionQuality:=50;
jpgstream.Compress;
...........
请问,有什么好方法,可以减少抓屏时CPU的占用啊
可是发现,当一端抓屏的时候,CPU资源一下子升高了,如果连续抓屏,就会影响正常使用电脑。其中关键抓屏代码:
var
image:Tbitmap;
jpgstream:Tjpegimage;
SCanvas:TCanvas;
memoryStream:TMemoryStream;
............
SCanvas:=TCanvas.Create;
SCanvas.Handle:=getDC(0);
image:=Tbitmap.Create;
image.Width:=Screen.Width;
image.Height:=Screen.Height;
image.Canvas.CopyRect(rect(0,0,screen.Width,screen.Height),Scanvas,rect(0,0,screen.Width,screen.Height));
jpgstream:=Tjpegimage.Create;
jpgstream.Assign(image);
jpgstream.CompressionQuality:=50;
jpgstream.Compress;
...........
请问,有什么好方法,可以减少抓屏时CPU的占用啊