procedure TForm1.btnClick(Sender: TObject);
var
bmp:TBitmap;
hCur : TCursorInfo;
begin
//ffffff-e2e2e2
cur :
= TIcon.Create;
bmp:
= TBitmap.Create;
ZeroMemory(@hCur,sizeof(hCur));
hCur.cbSize:
=SizeOf(hCur);
GetCursorInfo(hCur);
self.cur.Handle:
=hCur.hCursor ;
bmp.Width :
= cur.Width;
bmp.Height :
= cur.Height;
bmp.PixelFormat :
= pf24bit;
bmp.Canvas.Brush.Color :
= clFuchsia;
bmp.Canvas.Pen.Color :
= clFuchsia;
bmp.Canvas.Rectangle(
0,0,bmp.Width,bmp.Height );
if DrawIconEx(bmp.Canvas.Handle,0,0,self.cur.Handle,0,0,0,0,DI_NORMAL) then
bmp.SaveToFile(
'1.bmp');
Sleep(
10);
mmo.Lines.Add (dm.OcrInFile(
0,0,bmp.Width,bmp.Height,GetCurrentDir +'\1.bmp','ffffff-e2e2e2',1.0));
DeleteFile(GetCurrentDir
+'\1.bmp');
bmp.Free;
cur.Free;
end;

 

posted on 2010-09-16 14:48  °ι 、曲 终  阅读(755)  评论(0编辑  收藏  举报