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;

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2021-09-24
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
猜你喜欢
  • 2021-10-08
  • 2022-12-23
  • 2021-11-07
  • 2021-04-29
  • 2022-12-23
相关资源
相似解决方案