delphi 在屏幕外如何绘图
1个回答
展开全部
以下代码在全屏幕中心绘制一个十字架:
procedure TForm1.Button1Click(Sender: TObject);
var
FullscreenCanvas:TCanvas;
DC:HDC;
begin
DC:=GetDC(0);//取得屏幕的DC,参数0指的是屏幕
FullscreenCanvas := TCanvas.Create;//创建一个CANVAS对象
FullscreenCanvas.Handle := DC; //将画布关联到屏幕句柄,以便能做图
FullscreenCanvas.MoveTo(screen.Width div 2,0);
FullscreenCanvas.LineTo(screen.Width div 2,768);
FullscreenCanvas.MoveTo(0,Screen.Height div 2);
FullscreenCanvas.LineTo(1024,Screen.Height div 2);
end;
//以下代码实现定时在屏幕正中绘一个十字,一个正方形,一个圆形
procedure TForm1.Timer1Timer(Sender: TObject);
procedure TForm1.Button1Click(Sender: TObject);
var
FullscreenCanvas:TCanvas;
DC:HDC;
begin
DC:=GetDC(0);//取得屏幕的DC,参数0指的是屏幕
FullscreenCanvas := TCanvas.Create;//创建一个CANVAS对象
FullscreenCanvas.Handle := DC; //将画布关联到屏幕句柄,以便能做图
FullscreenCanvas.MoveTo(screen.Width div 2,0);
FullscreenCanvas.LineTo(screen.Width div 2,768);
FullscreenCanvas.MoveTo(0,Screen.Height div 2);
FullscreenCanvas.LineTo(1024,Screen.Height div 2);
end;
//以下代码实现定时在屏幕正中绘一个十字,一个正方形,一个圆形
procedure TForm1.Timer1Timer(Sender: TObject);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询