Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • 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
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
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.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

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