var
i,j,m,dc,whd:Integer;
Pee,Pff : PByteArray;
bmptmp,bmp1:tbitmap;
begin
whd:= FindWindow(nil,'Micka');
if whd=0 then Exit;
dc:=GetWindowDC(whd);
bmp1:=TBitmap.Create;
bmp1.PixelFormat:=pf24bit;
bmp1.Width:=22;
bmp1.Height:=34;
BitBlt(bmp1.Canvas.Handle,0,0,bmp1.Width,bmp1.Height,dc,154,30,SRCCOPY);
if bmp1=nil then exit;
bmptmp:=tbitmap.Create;
bmptmp.PixelFormat:=pf24bit;
try
for m:=0 to 4 do
begin //页面上有 5张imgage的bmp的比较图
bmptmp:=(self.FindComponent('img'+inttostr(m+1)) as Timage).Picture.Bitmap;
Pee:=nil;
Pff:=nil;
// for j:=30 to 62 do
for j:=0 to 32 do
begin
Pee:=bmp1.ScanLine[j];
Pff:=bmptmp.ScanLine[j];
for i:=0 to 20 do
begin
if Round((Pee[i * 3 + 2] + pee[i * 3 + 1] + pee[i* 3])/3)<>
Round((Pff[(i) * 3 + 2] + pff[(i) * 3 + 1] + pff[(i)* 3])/3) then
begin
break;
end;
end;
if i<=20 then//找到不同的 174
break;
end;
if j>=32 then //找到xiang同的 62
begin
exit;
end;
end;
finally
bmp1.Free;
bmptmp.Free;
end;
总是报无效的指针操作错;pointer...
i,j,m,dc,whd:Integer;
Pee,Pff : PByteArray;
bmptmp,bmp1:tbitmap;
begin
whd:= FindWindow(nil,'Micka');
if whd=0 then Exit;
dc:=GetWindowDC(whd);
bmp1:=TBitmap.Create;
bmp1.PixelFormat:=pf24bit;
bmp1.Width:=22;
bmp1.Height:=34;
BitBlt(bmp1.Canvas.Handle,0,0,bmp1.Width,bmp1.Height,dc,154,30,SRCCOPY);
if bmp1=nil then exit;
bmptmp:=tbitmap.Create;
bmptmp.PixelFormat:=pf24bit;
try
for m:=0 to 4 do
begin //页面上有 5张imgage的bmp的比较图
bmptmp:=(self.FindComponent('img'+inttostr(m+1)) as Timage).Picture.Bitmap;
Pee:=nil;
Pff:=nil;
// for j:=30 to 62 do
for j:=0 to 32 do
begin
Pee:=bmp1.ScanLine[j];
Pff:=bmptmp.ScanLine[j];
for i:=0 to 20 do
begin
if Round((Pee[i * 3 + 2] + pee[i * 3 + 1] + pee[i* 3])/3)<>
Round((Pff[(i) * 3 + 2] + pff[(i) * 3 + 1] + pff[(i)* 3])/3) then
begin
break;
end;
end;
if i<=20 then//找到不同的 174
break;
end;
if j>=32 then //找到xiang同的 62
begin
exit;
end;
end;
finally
bmp1.Free;
bmptmp.Free;
end;
总是报无效的指针操作错;pointer...
解决方案 »
- delphi 连接mysql 使用case 出现的一个问题
- 那位高人知道FOXMAIL是如何储存邮件的,是用的什么数据库?
- 高分送上->编辑.exe文件,恢复被病毒感染的文件。
- 求一简单字符串替换算法
- 如何清除指定目录下的所有文件?
- 怎样把dbgrid中的数据弄到listview中?
- if...then...else
- 绝对挑战!!!关注intraweb!!!高分求助!!!
- 有没有窗体上的分隔线?
- 奇怪问题,为什么我在DBGRID的HINT属性中定义了字符串,同时也设置SHOWHINT为TRUE了,可是就是显示不出来提示为什么?
- 老大们啊,ZeroMemory,Move的问题,进来看看
- delphi删除word中找到的一行文字
求大大解答~~