Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Fastest way to capture screen

Posted on 2003-11-13
8
Medium Priority
?
422 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 6

Accepted Solution

by:
GloomyFriar earned 100 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 100 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

636 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