不明白 scanline的出有关问题;小弟我估计是指针引起的;但是找不出解决办法;help!
不明白 scanline的出问题;我估计是指针引起的;但是找不出解决方法;help!~~~~~~~
总是报无效的指针操作错;pointer...
------解决方案--------------------
你跳跃测试一下看看,再将错误信息传上来看看
- Delphi(Pascal) code
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...
------解决方案--------------------
你跳跃测试一下看看,再将错误信息传上来看看