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
Solved

Bitmap....

Posted on 2000-03-16
6
289 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

828 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