🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.migration
2 messages
2 total messages Started by C�sar Sat, 23 Oct 2004 01:16
How to capture the Screen in C++Builder3.0?
#57
Author: C�sar
Date: Sat, 23 Oct 2004 01:16
6 lines
1021 bytes
Hi there,
I am trying to figure out achieve a Bitmap "ala" "Print Screen".
Any Hint? The famous "Screen" variable can be used to do this?
Thanks in advance,
C�sar
Re: How to capture the Screen in C++Builder3.0?
#60
Author: Andrea Biasi
Date: Sun, 07 Nov 2004 19:33
38 lines
2178 bytes
Hi cesar,

I use this code for capture screen to jpg file:

    HDC dc = GetDC(0);
    Graphics::TCanvas *ScreenCanvas = new Graphics::TCanvas;
    ScreenCanvas->Handle = dc;
    Image1->Picture->Bitmap->Width = Screen->Width;
    Image1->Picture->Bitmap->Height= Screen->Height;
    TRect rect = Rect(0,0,Screen->Width, Screen->Height);
    Image1->Picture->Bitmap->Canvas->CopyRect(rect, ScreenCanvas, rect);
    delete ScreenCanvas;
    ReleaseDC(NULL,dc);

  AnsiString datehour = FormatDateTime("yyyymmdd-hhnnss",Now());

    TJPEGImage *jp = new TJPEGImage();
    try {
        jp->Assign(Image1->Picture->Bitmap);
        jp->CompressionQuality=StrToInt(50);
        jp->SaveToFile(datehour+".jpg");
    }
  __finally
  {
    delete jp;
  }

Andrea Biasi


"C�sar" <lupus@usp.br> ha scritto nel messaggio
news:4179b0f5$1@newsgroups.borland.com...
>
> Hi there,
> I am trying to figure out achieve a Bitmap "ala" "Print Screen".
> Any Hint? The famous "Screen" variable can be used to do this?
> Thanks in advance,
> C�sar
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads