本文整理自网络,侵删。
function IsBmpSame(bmp1,bmp2: TBitmap): Boolean; var i,j: Integer; ScanLine1,ScanLine2: PByteArray; Count: Integer; begin Result := (bmp1.Height = bmp2.Height) and (bmp1.Width = bmp2.Width) and (bmp1.PixelFormat = bmp2.PixelFormat); if Result then begin i := Integer(bmp1.PixelFormat); if i < 4 then i := 4 else if i = 4 then inc(i); Count := (i - 3) * bmp1.Width - 1; for i:=0 to bmp1.Height-1 do begin ScanLine1 := bmp1.ScanLine[i]; ScanLine2 := bmp2.ScanLine[i]; for j := 0 to Count do if ScanLine1[j] <> ScanLine2[j] then begin Result := False; Exit; end; end; end; end
来源:http://www.coder163.com/language/delphi/
相关阅读 >>
Delphi 的 tstringbuilder 可以完美实现jave ,c#的tstringbuilder功能
Delphi 掌控pagecontrol中的右上方的左右箭头事件
Delphi 如何通过代码控制打开键盘数字锁定numlock
Delphi三层开发小技巧:tclientdataset的delta妙用
更多相关阅读请进入《Delphi》频道 >>