图片转文图类,学习中,求拍砖(200分)

  • 主题发起人 主题发起人 wind_2005
  • 开始时间 开始时间
W

wind_2005

Unregistered / Unconfirmed
GUEST, unregistred user!
我做了一个将文字或图片转换为文图的类,例如:
“学习”两个字,转换后的结果为
# # # #
# # # ##########
########### # #
# # # #
# ###### # # #
# #
# ## #
########### ## #
# #### #
# # #
### ###


在delphi的使用上,我还是个初学者,
简单写了这样一个类,希望各位能给以指正批评。
特别是:
1.代码的可读性,如何做更好?
2.代码是否规范,如何做更好?
3.类的结构是否合理,如何做更好?
4.变量、常量、过程等的名称是否起得合理,如何做更好?
5.目前这个类仅支持bmp转为文图,我试过将其他格式转为bmp再生成文图,但转换后的效果不好,如何支持其他图片格式
6.颜色级别中使用的字符是否合理?用哪些字符,如何排列更加合理?

我只希望自己能写出比较专业的代码来,也希望能与大家共勉
在这里,我先谢过大家了

类名为:TCharsGraphic
代码如下:
============================
unit CharsGraphic;

interface

uses
Classes, Graphics, Windows, StrUtils, Clipbrd;

const
MaxColorLevel: integer = 12; //最大颜色级别
c: array[0..12] of char = (' ','.','-',':',';','+','*','!','h','%','&','@','#') ; //各

颜色级别

type
TCreateMode =(cmSingleChar, cmDoubleChar); //生成模式:单字符,双字符
TCreateBeforeEvent = procedure of object;
TCreatingEvent = procedure(currentX, currentY: integer) of object;
TCreatedEvent = procedure of object;

type
TCharsGraphic = class(TObject)
private
FCreateBeforeEvent: TCreateBeforeEvent;
FCreatingEvent: TCreatingEvent;
FCreatedEvent: TCreatedEvent;
FHeight: integer;
FWidth: integer;
FAutoCopy: Boolean; //将结果自动复制到剪贴板
FCreateMode: TCreateMode;
protected
function ColorToChar(aColor: TColor):string; //颜色转换字符
procedure DoCreateBefore;
procedure DoCreatingEvent(currentX, currentY: integer);
procedure DoCreaed;
procedure SaveToClipboard(Text: string);
public
constructor Create();
function getCharsGraphic(const aString: string; const aFont: TFont):string; overload;
function getCharsGraphic(const aCanvas: TCanvas):string; overload;
property Width: integer read FWidth;
property Height: integer read FHeight;
property AutoCopy: Boolean read FAutoCopy write FAutoCopy;
property CreateMode: TCreateMode read FCreateMode write FCreateMode;
published
property OnCreateBefore: TCreateBeforeEvent read FCreateBeforeEvent write

FCreateBeforeEvent;
property OnCreating: TCreatingEvent read FCreatingEvent write FCreatingEvent;
property OnCreated: TCreatedEvent read FCreatedEvent write FCreatedEvent;
end;


implementation

uses SysUtils;

{ TCharsGraphic }

function TCharsGraphic.getCharsGraphic(const aString: string;
const aFont: TFont): string;
var
aPicture: TPicture;
begin
aPicture := TPicture.Create;
try
aPicture.Bitmap.Width := 200;
aPicture.Bitmap.Height := 40;
with aPicture.Bitmap.Canvas do
begin
Font.Color := aFont.Color;
Font.Name := aFont.Name;
Font.Size := aFont.Size;
Font.Style := aFont.Style;
TextOut(0,0,trim(aString));
end;
Result := getCharsGraphic(aPicture.Bitmap.Canvas);
finally
FreeAndNil(aPicture);
end;

end;


procedure TCharsGraphic.DoCreatingEvent(currentX, currentY: integer);
begin
if Assigned(FCreatingEvent) then FCreatingEvent(currentX, currentY);
end;

function TCharsGraphic.getCharsGraphic(const aCanvas: TCanvas): string;
var
curY: integer;
curX: integer;
curChars: string;
curLine: string;
CharsGraphic: TStrings;
begin
FWidth := aCanvas.ClipRect.Right;
FHeight := aCanvas.ClipRect.Bottom;

DoCreateBefore;

CharsGraphic := TStringList.Create;
try

for curY := 0 to FHeight -1 do
begin
curLine := '';
for curX := 0 to FWidth - 1 do
begin
curChars :=ColorToChar(aCanvas.Pixels[curX,curY]);
curLine := curLine + curChars;

DoCreatingEvent(curX, curY);
end;
CharsGraphic.Add(curLine);
end;

Result := CharsGraphic.Text;
finally
FreeAndNil(CharsGraphic);
end;

DoCreaed;
if FAutoCopy then SaveToClipboard(Result);
end;


constructor TCharsGraphic.Create;
begin
FWidth := -1;
FHeight := -1;
FAutoCopy := False;
FCreateMode := cmSingleChar;
end;

procedure TCharsGraphic.DoCreateBefore;
begin
if Assigned(FCreateBeforeEvent) then FCreateBeforeEvent;
end;

procedure TCharsGraphic.SaveToClipboard(Text: string);
begin
Clipboard.AsText := Text;
end;

procedure TCharsGraphic.DoCreaed;
begin
if Assigned(FCreatedEvent) then FCreatedEvent;
end;

function TCharsGraphic.ColorToChar(aColor: TColor): string;
var
R,B,G: integer;
ColorLevel : integer;
begin
R := GetRValue(aColor);
B := GetBValue(aColor);
G := GetGValue(aColor);

ColorLevel := ((R + B + G) div 3) div (255 div MaxColorLevel) ;

case CreateMode of
cmSingleChar:
Result := c[MaxColorLevel-ColorLevel];
cmDoubleChar:
Result := c[MaxColorLevel-ColorLevel] + c[MaxColorLevel-ColorLevel];
else
raise Exception.Create('生成模式有误');
end;
end;

end.


为了方便各位测试我也将测试程序的窗体代码帖出来:
窗体定义:Unit1.dfm
==============================
object Form1: TForm1
Left = 264
Top = 200
Width = 696
Height = 479
Caption = #22270#29255#36716#25991#22270#24037#20855
Color = clBtnFace
DragMode = dmAutomatic
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
OnDestroy = FormDestroy
PixelsPerInch = 96
TextHeight = 12
object imgSource: TImage
Left = 71
Top = 285
Width = 70
Height = 54
DragMode = dmAutomatic
Picture.Data = {
07544269746D6170EE2C0000424DEE2C00000000000036000000280000004600
0000360000000100180000000000B82C00000000000000000000000000000000
0000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39FFFFFFFFFFFFFFFFFFA56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39FFFFFFA56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39FFFF
FFFFFFFFFFFFFFFFFFFFA56D39A56D39A56D39A56D39FFFFFFFFFFFFFFFFFFA5
6D39FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA56D39A56D39FFFFFFFFFFFFFFFFFF
A56D39A56D39FFFFFFFFFFFFFFFFFFA56D39FFFFFFFFFFFFA56D39FFFFFFFFFF
FFFFFFFFA56D39A56D39FFFFFFFFFFFFFFFFFFFFFFFFA56D39A56D39FFFFFFFF
FFFFFFFFFFFFFFFFA56D39A56D39FFFFFFFFFFFFFFFFFFFFFFFFA56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39FFFFFFA56D39A56D39FFFF
FFA56D39A56D39FFFFFFA56D39A56D39A56D39A56D39A56D39A56D39FFFFFFA5
6D39A56D39A56D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39A56D39FFFFFF
A56D39A56D39FFFFFFA56D39A56D39A56D39FFFFFFA56D39A56D39A56D39A56D
39FFFFFFA56D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39A56D39FFFFFFA5
6D39FFFFFFA56D39A56D39A56D39FFFFFFA56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39A56D39FFFFFFFFFF
FFFFFFFFFFFFFFA56D39A56D39A56D39FFFFFFA56D39A56D39A56D39A56D39FF
FFFFA56D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39
A56D39A56D39FFFFFFA56D39A56D39A56D39A56D39FFFFFFA56D39A56D39FFFF
FFA56D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39A56D39A56D39A56D39A5
6D39FFFFFFA56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
0000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39FFFFFF
A56D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39A56D
39A56D39FFFFFFA56D39A56D39A56D39A56D39FFFFFFA56D39A56D39FFFFFFA5
6D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39A56D39A56D39FFFFFFA56D39
A56D39A56D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39A56D39FFFFFFA56D
39A56D39FFFFFFA56D39A56D39A56D39A56D39FFFFFFA56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39
A56D39A56D39FFFFFFFFFFFFA56D39A56D39A56D39A56D39FFFFFFA56D39A56D
39A56D39FFFFFFFFFFFFFFFFFFFFFFFFA56D39A56D39A56D39FFFFFFFFFFFFFF
FFFFA56D39A56D39A56D39FFFFFFFFFFFFA56D39A56D39A56D39A56D39FFFFFF
FFFFFFFFFFFFA56D39A56D39A56D39FFFFFFFFFFFFFFFFFFA56D39A56D39A56D
39FFFFFFFFFFFFA56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39FFFFFFA56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39FFFFFFA56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39
A56D39FFFFFFA56D39A56D39FFFFFFA56D39FFFFFFA56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39FFFFFFA56D39A5
6D39FFFFFFA56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
FFFFFFA56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39FFFFFFA56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39A56D39FFFFFFA56D39A56D39
FFFFFFA56D39FFFFFFA56D39A56D39A56D39FFFFFFA56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39FFFFFFFFFFFFFFFFFFFFFFFFA56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39FFFFFFFFFFFFFFFFFFA56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39FFFFFFFFFFFFA56D39A56D39A56D
39A56D39A56D39A56D39FFFFFFA56D39A56D39A56D39FFFFFFFFFFFFFFFFFFFF
FFFFA56D39A56D39FFFFFFFFFFFFFFFFFFFFFFFFA56D39A56D39A56D39FFFFFF
FFFFFFFFFFFFFFFFFFA56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
0000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39000000000000000000
000000000000000000000000000000000000000000000000A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39848684FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFF000000A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D3984
8684FFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39848684FFFFFFFFFFFF000000FF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000
000000000000000000000000A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39848684FFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
0000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39848684FFFF
FFFFFFFF000000000000000000FFFFFF000000FFFFFFFFFFFF000000FFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39848684FFFFFFFFFFFFFFFFFF0000000000
00000000000000FFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFF000000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39848684FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000FFFFFFFFFF
FF000000848684848684848684848684848684FFFFFFFFFFFF000000A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39848684FFFFFFFFFFFF
FFFFFF000000000000000000000000FFFFFFFFFFFF000000FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFF000000000000000000000000000000000000000000A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39848684FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFF000000848684848684848684848684C6C7C600000000FF
FF00FFFF00FFFF00FFFF00FFFF000000A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D3984
8684848684848684848684848684848684848684848684848684848684000000
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFF00FFFF00FFFF00FFFF00FF
FF000000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39848684FFFFFFFFFFFF848684848684848684848684848684848684848684
C6C7C600000000FFFF00FFFF00FFFF00FFFF00FFFF000000A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39848684FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFF00FFFF
00FFFF00FFFF00FFFF000000A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
0000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39848684FFFFFFFFFFFF84868484868484868484868484
8684848684848684C6C7C6000000000000000000000000000000000000000000
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D398486
84FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFF000000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39848684FFFFFFFFFFFF8486848486
84848684848684848684848684848684C6C7C600000000000000000000000000
0000000000000000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39848684FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFF00000000FFFF00FFFF00FFFF00FFFFFFFFFF000000A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39848684FFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC6C7C600000000FF
FF00FFFF00FFFF00FFFF00FFFFFFFFFF000000A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39848684FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFC6C7C600000000FFFF00FFFF00FFFF00FFFF00FF
FF00FFFF848684C6C7C6A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39848684FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
C6C7C6FFFFFF00000000FFFF00FFFF00FFFF00FFFF00FFFF00FFFF8486840000
00A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D3984868484868484868484
8684848684848684848684848684848684848684848684848684A56D39C6C7C6
00000000FFFF00FFFF00FFFF00FFFF00FFFFC6C7C6848684A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
0000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D3900000000FFFF00FFFF
00FFFF00FFFF00FFFF000000A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D3900000000000000000000000000
0000000000A56D39A56D39A56D3900000000FFFF00FFFF00FFFF00FFFF000000
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D3900000000FFFF00FFFF00FFFF00FFFF000000A56D39A56D39A5
6D3900000000FFFF00FFFF00FFFF00FFFF000000A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D3900000000FF
FF00FFFF00FFFF00FFFF000000A56D39A56D39A56D3900000000FFFF00FFFF00
FFFF00FFFF000000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D3900000000FFFF00FFFF00FFFF00FFFF00FF
FF00000000000000000000FFFF00FFFF00FFFF00FFFF00FFFF000000A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39C6C7C600000000FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF
FF00FFFF00FFFF00FFFF000000C6C7C6A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39848684C6C7C6
00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFFC6C7C60000
00A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D3984868400000000FFFF00FFFF00FFFF
00FFFF00FFFF00FFFF00FFFF000000000000A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
0000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39848684000000000000000000000000000000848684
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D390000A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D390000A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D390000A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D
39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A5
6D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D39
A56D39A56D39A56D39A56D39A56D39A56D39A56D39A56D390000}
Stretch = True
end
object btnLoadPic: TButton
Left = 21
Top = 355
Width = 164
Height = 25
Caption = #25171#24320#22270#29255#24182#36716#25442
TabOrder = 0
OnClick = btnLoadPicClick
end
object mmoTarget: TMemo
Left = 206
Top = 8
Width = 461
Height = 406
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = #26999#20307'_GB2312'
Font.Style = []
ParentFont = False
ScrollBars = ssBoth
TabOrder = 1
end
object stat1: TStatusBar
Left = 0
Top = 433
Width = 688
Height = 19
Panels = <>
end
object rb1: TRadioButton
Left = 47
Top = 28
Width = 124
Height = 17
Caption = #21333#23383#31526
Checked = True
TabOrder = 3
TabStop = True
OnClick = rb1Click
end
object rb2: TRadioButton
Left = 47
Top = 52
Width = 124
Height = 17
Caption = #21452#23383#31526
TabOrder = 4
OnClick = rb1Click
end
object edt1: TEdit
Left = 18
Top = 169
Width = 164
Height = 20
TabOrder = 5
Text =

#25105#30340#19990#30028#24320#22987#19979#38634#65292#20013#21326#20154#27665#20849#21644#2

2269
end
object btn1: TButton
Left = 18
Top = 193
Width = 164
Height = 25
Caption = #35774#32622#23383#20307#24182#36716#25442
TabOrder = 6
OnClick = btn1Click
end
object pb1: TProgressBar
Left = 5
Top = 415
Width = 675
Height = 16
TabOrder = 7
end
object chk1: TCheckBox
Left = 47
Top = 75
Width = 124
Height = 17
Caption = #33258#21160#23384#33267#21098#36148#26495
TabOrder = 8
OnClick = chk1Click
end
object dlgOpen: TOpenDialog
Left = 176
Top = 13
end
object dlgFont1: TFontDialog
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
Left = 176
Top = 42
end
end


窗体内代码:Unit1.pas
===========================
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, jpeg, ComCtrls, CharsGraphic,math;

type
TForm1 = class(TForm)
imgSource: TImage;
btnLoadPic: TButton;
mmoTarget: TMemo;
dlgOpen: TOpenDialog;
stat1: TStatusBar;
rb1: TRadioButton;
rb2: TRadioButton;
edt1: TEdit;
btn1: TButton;
dlgFont1: TFontDialog;
pb1: TProgressBar;
chk1: TCheckBox;
procedure btnLoadPicClick(Sender: TObject);
procedure btn1Click(Sender: TObject);
procedure btnAbortClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure rb1Click(Sender: TObject);
procedure chk1Click(Sender: TObject);
private
{ Private declarations }
isAbort: Boolean;
CreateMode: TCreateMode;
aCharsGraphic: TCharsGraphic;
procedure CreateBefore;
procedure CreatingGraphic(currentX, currentY: integer);
procedure CreateFinished;
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

uses StrUtils;

{$R *.dfm}

procedure TForm1.btnLoadPicClick(Sender: TObject);
begin
dlgOpen.Filter := 'bmp file|*.bmp';
if dlgOpen.Execute then
begin
imgSource.Picture.LoadFromFile(dlgOpen.FileName);
end;

if (imgSource.Picture.Width > 200) or (imgSource.Picture.Height>200) then
ShowMessage('你打开的图片尺寸较大,转换过程可能较慢');

mmoTarget.Lines.Clear;
mmoTarget.Text := aCharsGraphic.getCharsGraphic(imgSource.Picture.Bitmap.Canvas);

end;

procedure TForm1.btn1Click(Sender: TObject);
begin
if dlgFont1.Execute then
begin
mmoTarget.Clear;
mmoTarget.Text := aCharsGraphic.getCharsGraphic(trim(edt1.Text),dlgFont1.Font);
end;
end;

procedure TForm1.btnAbortClick(Sender: TObject);
begin
isAbort := true;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
aCharsGraphic := TCharsGraphic.Create;
aCharsGraphic.OnCreateBefore := CreateBefore;
aCharsGraphic.OnCreating := CreatingGraphic;
aCharsGraphic.OnCreated := CreateFinished;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
FreeAndNil(aCharsGraphic);
end;

procedure TForm1.rb1Click(Sender: TObject);
begin
if rb1.Checked then
aCharsGraphic.CreateMode := cmSingleChar
else
aCharsGraphic.CreateMode := cmDoubleChar;
end;

procedure TForm1.CreatingGraphic(currentX, currentY: integer);
begin
pb1.Position := pb1.Position + 1;
end;

procedure TForm1.CreateBefore;
begin
pb1.Position := 0;
pb1.Min := 0;
pb1.Max := aCharsGraphic.Height * aCharsGraphic.Width;
end;

procedure TForm1.chk1Click(Sender: TObject);
begin
if chk1.Checked then
aCharsGraphic.AutoCopy := True
else
aCharsGraphic.AutoCopy := False;
end;

procedure TForm1.CreateFinished;
begin
ShowMessage('finished!');
end;

end.
 
如果要使用多种格式,你可以使用GDI+类来进行处理
 
谢谢satori,我试试看
 
自已顶一下,只是期望能向大家多多学习,共同进步
 
有想法,世界需要你这样的人
 
呵呵,iamy,见笑了,
还是希望大家多多提意见才好,
如果有可能的话,希望能把这个小工具和大家一块完成,做一个像样的东西来
 
[:(]好像没人支持哦,自己顶一把吧
 
有人愿意共同讨论吗?
提提开发方面的想法、建议或意见都可以啊,
这200分总行送出去哦[:(]
 
没人愿意参与,那散分了,大家来接分吧,
不过还是希望各位能给以建议,谢谢!
 
送分,大家来领!!
 
散分,来者有份。
 
送分,大家来领!!
 
我接!~~~
 
看一下,现在用不上,呵呵,不过好象可以用来识别验证码之类的
 
继续散分,大家来接,当然,能提建议更好,谢谢
 

Similar threads

I
回复
0
查看
709
import
I
I
回复
0
查看
673
import
I
I
回复
0
查看
571
import
I
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
566
import
I
后退
顶部