Buscar

Função captura a tela e salva-a em um bmp

Código

//Use-a assim:
//Image1.picture.Assign(CaptureScreenRect(Rect(0,0,Width,Height)));
function CaptureScreenRect( ARect: TRect ): TBitmap;
var
ScreenDC: HDC;
begin
Result := TBitmap.Create;
with Result, ARect do
begin
Width := Right - Left;
Height := Bottom - Top;
ScreenDC := GetDC( 0 );
try
BitBlt( Canvas.Handle, 0, 0, Width, Height, ScreenDC, Left, Top, SRCCOPY );
finally
ReleaseDC( 0, ScreenDC );
end;
// Palette := GetSystemPalette;
end;
end;

Publicidade

Vote na dica




Quantidade de votos: 0 votos
Aceitação: 0%


Detalhes da dica

Categoria: Imagens
Adicionada dia: 20/06/03
Por: Felipe Monteiro
Visualizada: 2914 vezes

Planeta Delphi - Tudo sobre programação Delphi Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009