Z
zggsbd
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Timer1Timer(Sender: TObject);
var
Fullscreen:Tbitmap;
FullscreenCanvas:TCanvas;
dc:HDC;
begin
Fullscreen := TBitmap.Create; // 创建一个 BITMAP 来存放图象
Fullscreen.Width := screen.width;
Fullscreen.Height := screen.Height;
DC := GetDC (0); // 取得屏幕的 DC,参数 0 指的是屏幕
FullscreenCanvas := TCanvas.Create; // 创建一个 CANVAS 对象
FullscreenCanvas.Handle := DC;
Fullscreen.Canvas.CopyRect(Rect (0, 0, screen.Width, screen.Height),
fullscreenCanvas,Rect (0, 0, Screen.Width, Screen.Height));// 把整个屏幕复制到 BITMAP 中
FullscreenCanvas.Free; // 释放 CANVAS 对象
ReleaseDC (0, DC); // 释放 DC
//*******************************
image1.picture.Bitmap:=fullscreen;// 拷贝下的图象赋给 IMAGE 对象
image1.Width:=fullscreen.Width;
image1.Height:=fullscreen.Height;
fullscreen.free; // 释放 bitmap
end;
屏幕截图,为什么截不到鼠标指针(小箭头)?
var
Fullscreen:Tbitmap;
FullscreenCanvas:TCanvas;
dc:HDC;
begin
Fullscreen := TBitmap.Create; // 创建一个 BITMAP 来存放图象
Fullscreen.Width := screen.width;
Fullscreen.Height := screen.Height;
DC := GetDC (0); // 取得屏幕的 DC,参数 0 指的是屏幕
FullscreenCanvas := TCanvas.Create; // 创建一个 CANVAS 对象
FullscreenCanvas.Handle := DC;
Fullscreen.Canvas.CopyRect(Rect (0, 0, screen.Width, screen.Height),
fullscreenCanvas,Rect (0, 0, Screen.Width, Screen.Height));// 把整个屏幕复制到 BITMAP 中
FullscreenCanvas.Free; // 释放 CANVAS 对象
ReleaseDC (0, DC); // 释放 DC
//*******************************
image1.picture.Bitmap:=fullscreen;// 拷贝下的图象赋给 IMAGE 对象
image1.Width:=fullscreen.Width;
image1.Height:=fullscreen.Height;
fullscreen.free; // 释放 bitmap
end;
屏幕截图,为什么截不到鼠标指针(小箭头)?