主要类完成个人印章的设计,包括外框以及名称 unit SelfSeal;
interface uses Types, SysUtils, Windows, Graphics, ExtCtrls, IniFiles;
const SealFile = 'SealFile'; //文件夹 iniFile = 'SealFile.ini'; //参数文件 type TSealParameter = record FontName: TFontName; //TFontName '宋体', Angle: Integer; //Angle Left, //x, 左边距 Top, // y 上边距 FontHeight, //,H_ 设置字高 FontWidth, //W_, 设置字宽 FontWeight, //WT 字体笔划粗细程度 FontSpace: Integer; //文字间隔 Rectangle: TRect; //外框 RecWeight: Integer; end;
{个人印章类} TSealPic = class private FSealStr: string; //签名字符 FSealName: string; //签名文件名 FSourceCanvas: TCanvas; //来源画布图 FSealPath: string; //印章所在路径 FSealParameter: TSealParameter; //印章文字参数
procedure DrawTextEx(ACanvas: TCanvas; FN_: TFontName; Angle, x, y, H_, W_, WT: Integer; AStr: string); //生成字符 procedure SaveToIni; //参数保存到INI procedure LoadFromIni; //参数从INI读取
protected WorkPath: string; public constructor Create; overload; destructor destroy; overload; function SaveToFile: Boolean; //保存印章文件 function SetStamp(): Boolean; //设置印章 procedure IniParameter; //根据姓名字数初始化文字参数
property SealStr: string read FSealStr write FSealStr; //签名字符 property SealName: string read FSealName write FSealName; //签名文件名 property SourceCanvas: TCanvas read FSourceCanvas write FSourceCanvas; //来源画布 property SealParameter: TSealParameter read FSealParameter write FSealParameter; //印章文字参数 property SealPath: string read FSealPath write FSealPath; //签名字符
end; |