Bitmap....

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.        
fantasma110899Asked:
Who is Participating?
 
ckanetaCommented:
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
 
fantasma110899Author Commented:
When I try this code and say bmp.SaveToFile the .bmp is 0 bytes long. Is bmp of TBitmap type?
0
 
rwilson032697Commented:
You will need to size the bitmap to the screen witdh and height.

Cheers,

Raymond.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
fantasma110899Author Commented:
How can I share the points between the two answer?
0
 
rwilson032697Commented:
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
 
fantasma110899Author Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.