유돌이

calendar

1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

Notice

2019. 9. 23. 10:50 델파이

procedure TFPAT070M.CaptureForm; 
var 
    Pt  :TPoint;     // 캡쳐할 화면의 Left, Top 좌표 
    DC  :HDC; 
    Bmp :TBitmap; 
begin 
 
  // 폼전체를 하기 위해 (0, 0) 으로 설정하였다. 
  Pt.x := 0;   // x => 폼에서의 Left 값 
  Pt.y := 0;   // y => 폼에서의 Top  값 
 
  // 폼의 좌표를 스크린 좌표로 변환한다. 
  Pt := ClientToScreen(Pt);                    
 
  // 캡쳐할 비트맵 생성 
  Bmp := TBitMap.Create; 
 
  try 
     // 비트맵 크기 지정 => 폼전체를 하기위해 폼의 크기를 지정하였다. 
     Bmp.Width  := Width; 
     Bmp.Height := Height; 
     DC := GetDC(0); 
     BitBlt(Bmp.Canvas.Handle, 0, 0, Bmp.Width, Bmp.Height, DC, Pt.x , Pt.y, SRCCOPY); 
     ReleaseDC(0,DC); 
 
     Bmp.SaveToFile(Name + '.bmp')    // 비트맵 파일로 저장 
     // Clipboard.Assign(Bmp);        // 클립보드로 복사 
  finally 
     Bmp.Free; 
  end; 
 
end; 

'델파이' 카테고리의 다른 글

E1026 File not found: Controls.res  (0) 2019.09.24
Virtual Key Codes  (0) 2019.09.23
델파이 기초 - WebBrowser 기능 정리  (0) 2011.09.22
TWebBrowser에 직접 HTML 소스코드 넣기  (0) 2011.07.05
Creating and Using DLLs from Delphi  (0) 2011.07.05
posted by 유돌이