kapot
asked on
Fastest way to capture screen
I need a fastest way to capture a screen.
The scenario:
- I play an AVI file in screen position 0,0
- within 1 second, I will try to capture as much as possible in that screen position with size = 320x240
- Each captured image will be saved as JPG.
Currently, I am using Bitblt like this :
DC := getDC(GetDesktopWindow);
jpg.CompressionQuality := 60;
done := FALSE;
Timer1.Interval := 1000;
Timer1.Enabled := TRUE;
while not done do
begin
BitBlt(bmp.Canvas.Handle, 0, 0, 320, 240, DC, 0, 0, SRCOPY);
jpg.Assign(bmp);
jpg.SaveToFile('capture'+I ntToStr(ct r)+'.jpg') ;
Inc(ctr);
Application.ProcessMessage ;
end;
ReleaseDC(DC, DC);
Using Pentium 4 2.0 GHz, I can capture about 53 files.
But I need to optimize this code. Is it possible?
The scenario:
- I play an AVI file in screen position 0,0
- within 1 second, I will try to capture as much as possible in that screen position with size = 320x240
- Each captured image will be saved as JPG.
Currently, I am using Bitblt like this :
DC := getDC(GetDesktopWindow);
jpg.CompressionQuality := 60;
done := FALSE;
Timer1.Interval := 1000;
Timer1.Enabled := TRUE;
while not done do
begin
BitBlt(bmp.Canvas.Handle, 0, 0, 320, 240, DC, 0, 0, SRCOPY);
jpg.Assign(bmp);
jpg.SaveToFile('capture'+I
Inc(ctr);
Application.ProcessMessage
end;
ReleaseDC(DC, DC);
Using Pentium 4 2.0 GHz, I can capture about 53 files.
But I need to optimize this code. Is it possible?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
does anybody know a sample to copy screen using DirectX by Delphi ???
try to capture not the hole screen, just the range that is usefull for you...
put all pictures in a stream in your own format, and make pictures after you've finished the capture.
regards,
Zoltan.
put all pictures in a stream in your own format, and make pictures after you've finished the capture.
regards,
Zoltan.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
anybody can give me a delphi sample to capture screen using DirectX ?
Geoff M.