Solved

Fastest way to capture screen

Posted on 2003-11-13
8
412 Views
Last Modified: 2012-05-04
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'+IntToStr(ctr)+'.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?

0
Comment
Question by:kapot
8 Comments
 
LVL 6

Accepted Solution

by:
GloomyFriar earned 25 total points
ID: 9740047
I'm not shure, but I think that using DirectX will be faster.
0
 
LVL 8

Expert Comment

by:gmayo
ID: 9741338
Using JPG will slow it down (compression algorithms take time). Using BMP will use up more disk space and may take longer to write to disk. Try a different format (BMP, GIF, etc) and see whether it is any quicker.

Geoff M.
0
 

Expert Comment

by:LeVuHoang
ID: 9746028
does anybody know a sample to copy screen using DirectX by Delphi ???
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 2

Expert Comment

by:ZolikaP
ID: 9746581
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.
0
 
LVL 2

Assisted Solution

by:ZolikaP
ZolikaP earned 25 total points
ID: 9746609
0
 

Expert Comment

by:LeVuHoang
ID: 9753810
anybody can give me a delphi sample to capture screen using DirectX ?
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now