请问如何抓屏
解决方案 »
- TClientDataSet与TQuery赋值
- 怎样由 8 个 Button 的是否按下状态 生成 象11001100这样的8位字符数
- treeview的难题?在线等,解决即给分
- 大家开发MSSQLSERVER时都是用ADO控件连接的方式还是代码连接的方式啊?
- 数据库的连接问题
- 一个SUM()的问题,请问这个SQL语句怎么写?
- 100分 如何在系统找一个进程。加急!!!加急!!!加急!!!我想加很多的分可系统只让我加100
- 懂Delphi又知道BCB的请帮忙
- Delphi7 多表查询dbgrid不能更新显示
- 怎样让数据库一直连着呀?
- 串口问题?(在线等待.....)
- Delphi 与 Unix 通信的问题
RectWidth,RectHeight:integer;
SourceDC,DestDC,Bhandle:integer;
Bitmap:TBitmap;
begin
RectWidth:=RightPos-LeftPos;
RectHeight:=BottomPos-TopPos;
SourceDC:=CreateDC('DISPLAY','','',nil);
DestDC:=CreateCompatibleDC(SourceDC);
Bhandle:=CreateCompatibleBitmap(SourceDC,RectWidth,RectHeight);
SelectObject(DestDC,Bhandle);
BitBlt(DestDC,0,0,RectWidth,RectHeight,SourceDC,LeftPos,TopPos,SRCCOPY);
Bitmap:=TBitmap.Create;
Bitmap.Handle:=BHandle;
BitMap.SaveToFile(FileName);
end;
var
DC : HDC;
ABitmap : TBitmap;
CI: TCursorInfo;
begin
DC := GetDC(GetDesktopWindow);
ABitmap := TBitmap.Create;
try
ABitmap.Width := GetDeviceCaps(DC,HORZRES);
ABitmap.Height := GetDeviceCaps(DC,VERTRES); BitBlt(ABitmap.Canvas.Handle,
0,
0,
ABitmap.Width,
ABitmap.Height,
DC,
0,
0,
SRCCOPY);
ZeroMemory(@CI,SizeOf(CI));
CI.cbSize := SizeOf(CI);
if GetCursorInfo(CI) then
DrawIconEx(ABitmap.Canvas.Handle,
CI.ptScreenPos.X,
CI.ptScreenPos.Y,
CI.hCursor,
16,
16,
0,
0,
DI_DEFAULTSIZE OR DI_NORMAL); finally
ReleaseDC(GetDesktopWindow,DC);
end;
Result := ABitmap;
end;
转贴