Solved

Bitmap....

Posted on 2000-03-16
6
288 Views
Last Modified: 2013-12-03
Hi:

I need to capture the image of the whole the screen and put it in a bitmap. Later I need load this image in a stream in memory. How cam I do this?

                Thanks.        
0
Comment
Question by:fantasma110899
  • 3
  • 2
6 Comments
 
LVL 3

Accepted Solution

by:
ckaneta earned 10 total points
ID: 2625216
this should capture the desktop and copy it into a bitmap;

var DTop : TCanvas ;
 begin
  DTop := TCanvas.Create ;
  try
   with DTop do
    Handle := GetWindowDC (GetDesktopWindow) ;
    with bmp.Canvas do
     CopyRect(Rect(0,0,screen.width,screen.height),DTop,Rect(0,0,screen.width,screen.height))
  finally
   DTop.Free
  end ;
0
 

Author Comment

by:fantasma110899
ID: 2625695
When I try this code and say bmp.SaveToFile the .bmp is 0 bytes long. Is bmp of TBitmap type?
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2625749
You will need to size the bitmap to the screen witdh and height.

Cheers,

Raymond.
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

Author Comment

by:fantasma110899
ID: 2626005
How can I share the points between the two answer?
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2626302
Normally you would delete this Q and post dummy questions for the experts you want to award the points to.

In this case just award then to ckaneta :-)

Cheers,

Raymond.
0
 

Author Comment

by:fantasma110899
ID: 2627715
Thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Communication Between RC4 Delphi <-> PHP 3 114
FMX StringGrid1->Canvas->FillRect Problem 3 153
Working with hours 3 58
How are Button Fonts Created? 2 21
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 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