• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

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.        
0
fantasma110899
Asked:
fantasma110899
  • 3
  • 2
1 Solution
 
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now