[purple]没有您们说的那么容易,我不仅要取图片,还要跟其它的图片对比,是否是同张图片,
如指纹识别。我的意思是如何把字节数据快速转化为图像像素,并快速显示。blob字段中
存放的是256*300字节的颜色值。我的处理是如下,显示很慢:
procedure TForm1.Button1Click(Sender: TObject);
var
longstr,longstr1:ansistring;
size,C,m,wd,lg:integer;
tmpstr:string;
Achar:array of char;
pchar1
char;
textfile1:textfile;
clr:integer;
begin
if Not adoc1.Connected then
adoc1.Open;
with adoqr1 do
begin
close;sql.Clear;
sql.Add('select top 1 * from fingerindex where id=78');
open;
if Recordcount>0 then
begin
longstr:=TblobField(Fieldbyname('指纹数据')).AsVariant;
Size:=TBlobField(Fieldbyname('指纹数据')).BlobSize;
c:=0;m:=0;
wd:=10;lg:=100;
if size>0 then
begin
setlength(Achar,size);
longstr1:=longstr;
While Length(longstr1)>=1 do
begin
TmpStr:=Copy(longstr1,1,1);
pchar1:=Pchar(TmpStr);
Achar[C]:=pchar1[0];
if m=256 then
begin
form1.Canvas.Pixels[wd,lg]:=StringToColor('$'+inttoHex(integer(achar[c]),2)+'0000');
inc(lg);
wd:=10;
m:=0;
end
else
begin
form1.Canvas.Pixels[wd,lg]:=StringToColor('$'+inttoHex(integer(achar[c]),2)+'0000');
inc(wd);
end;
inc(m);
Inc(C);
longstr1:=Copy(longstr1,2,Length(longstr1)-1);
end;
end;
end;
end;
end;[/purple]