Delphi 比较两个位图是否相同

2022-12-09 16:24:13 作者:admin

本文整理自网络,侵删。

 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 返回程序执行参数的例子

Delphi 关于内存数据与 json

Delphi 常用控件属性

Delphi 获取鼠标坐标

android : assets与res/raw资源目录的区别

Delphi 调整应用程序内存大小

Delphi 突破主动防御

在 Delphi 中使用微软全文翻译的小例子

Delphi 中 inputquery 实现密码输入

Delphi tbitmap创建时提示object or class type required

更多相关阅读请进入《Delphi》频道 >>



在线咨询 拨打电话