⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example.pas

📁 控制扫描仪的源码,可以方便的控制扫描仪及照像机
💻 PAS
字号:
unit Example;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Image1: TImage;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
    procedure MyMsg(var Msg: TMsg; var Handled: Boolean);
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

uses
  Scanners;

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.OnMessage := MyMsg;
  TWOpenDSM(Application.Handle);
end;

procedure TForm1.MyMsg(var Msg: TMsg; var Handled: Boolean);
begin
  Handled := ProcessSourceMessage(Msg);
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  Application.OnMessage := nil;
  if TWIsDSEnabled then
    TWDisableDS;
  if TWIsDSOpen then
    TWCloseDS;
  if TWIsDSMOpen then
    TWCloseDSM;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  TWAcquire(Application.Handle, Image1.Picture.Bitmap, True);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  TWSelectDS;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -