5월, 2011의 게시물 표시

리눅스 전원 끄기 - shutdown과 halt

전원끄기 halt는 옵션 없삼 전원끄기 shutdown -h now 리부팅하기 shutdown -r now 유용하게 쓰입니다. =.=ㅋ

스크린샷을 델파이로 만들어 보자!!

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