如何抓取屏幕上的鼠标,有没有快速抓屏幕的方法?(100分)

  • 主题发起人 主题发起人 hxy2002
  • 开始时间 开始时间
H

hxy2002

Unregistered / Unconfirmed
GUEST, unregistred user!
如何抓取屏幕上的鼠标,有没有快速抓屏幕的方法?
 
1.鼠标吗就要自己先判断鼠标的位置再画上去了,没有更好的办法,也可能有我不知道
2.快速抓屏幕的办法好象就是直接拷贝了,再不就是分几个线程拷贝不同的区域,然后合
成一幅图片可能快些
 
我写的C++Builder的代码,老兄,你自已改吧!
void CopyScreen(Graphics::TBitmap *bmp1,int top,int left,int right,int bottom)
{
bmp1->Width=right-left;
bmp1->Height=bottom-top;
HDC ScreenDC;
ScreenDC=GetDC(0);
BitBlt(bmp1->Canvas->Handle, 0, 0, right-left,bottom-top, ScreenDC,left,top, SRCCOPY);
ReleaseDC(0, ScreenDC);
TPoint mousepos;
GetCursorPos(&mousepos);
TIcon *ic=new TIcon();
ic->Handle=GetCursor();
bmp1->Canvas->Draw(mousepos.x,mousepos.y,ic);
delete ic;

}
 
这段代码就是截鼠标的!
TPoint mousepos;
GetCursorPos(&mousepos);
TIcon *ic=new TIcon();
ic->Handle=GetCursor();
bmp1->Canvas->Draw(mousepos.x,mousepos.y,ic);
delete ic;
 
多人接受答案了。
 
后退
顶部