|
프린트 스크린의 키 값은 VK_SNAPSHOT 입니다.
그렇지만 키를 눌러서 화면을 캡쳐 하는 방식은 클립보드 처리를 또 해야하므로
일반적인 캡쳐 방법으로는 별로 추천해 드리고 싶지 않습니다.
아래는 화면의 내용을 캡쳐해서 C:\Text.BMP로 저장하는 예제입니다.
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Graphics::TBitmap *btBitmap = new Graphics::TBitmap;
HDC hdDC = GetDC(0);
btBitmap->Width = Screen->Width;
btBitmap->Height = Screen->Height;
btBitmap->PixelFormat = pf24bit;
BitBlt(btBitmap->Canvas->Handle, 0, 0, Screen->Width, Screen->Height, hdDC, 0, 0, SRCCOPY);
btBitmap->SaveToFile("C:\\Test.BMP");
ReleaseDC(0, hdDC);
delete btBitmap;
}
//---------------------------------------------------------------------------
이성제 님이 쓰신 글 :
: 현재 화면 그대로를 bmp 나 jpg로 저장하는 그런것은 없나요?
:
: 가능하기는 한가?
:
: 아님 프린트 스크린 키 핵사값이 있나요?
|