delphi微软手写输入法源码interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,OleServer,MSINKAUTLib_TLB,ExtCtrls,StdCtrls,MSINKAUTLib;typeTForm1=class(TForm)InkCLT:TInkCollector;Memo1:TMemo;Panel1:TPanel;Button1:TButton;InkRecognizerContext1:TInkRecognizerContext;procedureFormCreate(Sender:TObject);procedureInkCLTStroke(ASender:TObject;constCursor:IInkCursor;constStroke:IInkStrokeDisp;varCancel:WordBool);procedureButton1Click(Sender:TObject);private{Privatedeclarations}public{Publicdeclarations}end;varForm1:TForm1;implementation{$R*.dfm}procedureTForm1.FormCreate(Sender:TObject);beginInkCLT.hWnd:=panel1.Handle;InkCLT.Enabled:=true;InkCLT.DefaultDrawingAttributes.Color:=clRed;//墨水颜色InkCLT.DefaultDrawingAttributes.Width:=200;//笔的宽度end;procedureTForm1.InkCLTStroke(ASender:TObject;constCursor:IInkCursor;constStroke:IInkStrokeDisp;varCancel:WordBool);beginMemo1.Lines.Clear;Memo1.Lines.Add(Stroke.Ink.Strokes.ToString);end;procedureTForm1.Button1Click(Sender:TObject);beginInkCLT.Ink.DeleteStrokes(InkCLT.Ink.Strokes);Panel1.Refresh;end;end.
2023/8/17 20:53:57
9.38MB
手写输入法
1