
25.06.2010, 03:16
|
Прохожий
|
|
Регистрация: 25.06.2010
Сообщения: 5
Репутация: 10
|
|
Код:
var
Form1: TForm1;
ASrc, ADst :Tbitmap;
K : Double;
procedure TForm1.btn1Click(Sender: TObject);
begin
ADst := TBitmap.Create;
ADst.Width := Screen.Width;
ADst.Height := Screen.Height;
BitBlt(ADst.Canvas.Handle, 0,0, Screen.Width, Screen.Height,
GetDC(0), 0,0,SRCCOPY);
If (ASrc = Nil) Or (ADst = Nil) Then
Raise Exception.Create('Source or destination is Nil');
ADst.Width := Round(ASrc.Width / Sqrt(K));
ADst.Height := Round(ASrc.Height / Sqrt(K));
ADst.Canvas.StretchDraw(Rect(0,0,ADst.Width,ADst.Height),ASrc);
//ADst.Picture.Assign(ADst);
ADst.SavetoFile('D:\123.jpg');
ADst.Free;
end;
Выдает Source or destination is Nil. Извините, туплю =)
|