如题
解决方案 »
- 如何用INI文件 快速保存控件的值和从INI中 读取值再赋给 控件?
- 在ehlib的DBGridEh输入数据时,如何控制一定要先输入某栏位,才能输入另外一个栏位??
- 请各位帮帮我啊 delphi 中如何设置EXCEL单元格的属性阿?比如改为数值型!
- ◎◎◎◎◎年底了,最忙的时刻到了◎◎◎◎◎
- 4000寻DELPHI程序员
- 如何在报表中控制每页只打6条记录 ,而且是打相同的记录.十万火急!!!急急。。。。在线等!!
- 线程中进出队列的同步问题,急急急,在线等
- 帮帮我!
- 请教下,怎么用DELPHI演示PPT
- 如何改变DBGRID那讨厌的拖动条的不规则的情况。
- ado用update出现地址错误?急
- 怎样把表合并啊?数据库为SQL Server2000
var
P1:PByteArray;
i,j,j1:Integer;
preSx,startx,starty,endx,endy,preL,length,jiange,lines:integer;
b:Byte;
Begin
Form2.ListBox2.Clear;
startx:=-1;//黑块横坐标
starty:=-1;//黑块纵坐标
endx:=-1;
length:=0;//黑块长度
jiange:=0;//黑点间隔,用于判断黑点是否干扰点
lines:=0;//黑块总数
for i:=0 to Bmp.Height-1 do
begin
P1:=Bmp.ScanLine[i];
j1:=0;
startx:=-1;
endx:=-1;
length:=0;
jiange:=0;
for j:=0 to Bmp.Width-1 do
begin
//寻找第一个黑点
if (P1[j1]=0) and (startx=-1) then
begin
startx:=j;
jiange:=0;
Inc(j1,3);
continue;
end;
//计算黑点的长度
if (P1[j1]=0) and (startx<>-1) then
begin
length:=length+1;
endx:=j;
jiange:=0;
Inc(j1,3);
continue;
end;
//计算白点长度
if (P1[j1]=255) and (startx<>-1) then
begin
jiange:=jiange+1;
end; if jiange>9 then
begin
if length>18 then //找到了一个黑块
begin break;
end
else
begin //干扰黑点
startx:=-1;
starty:=-1;
endx:=-1;
endy:=-1;
length:=0;
jiange:=0;
end;
end;
Inc(j1,3);
end;
if (length>18)and((abs(preL-length)>18) or (abs(preSx-startx)>50)) then
begin //增加黑块
Form2.ListBox2.Items.Add('('+inttostr(startx)+','+inttostr(endx)+','+inttostr(i)+')'+inttostr(length));
lines:=lines+1;
end;
preSx:=startx;preL:=length;
end;
Form2.ListBox2.Items.Add(inttostr(lines)+'行');
end;