delphi比较两个位图是否相同


本文整理自网络,侵删。

 

引用
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; 

相关阅读 >>

Delphi 如何判断某一窗口最大化

Delphi 运行时提升软件到管理员权限

Delphi tms web core直接从html&css设计的页面布局

Delphi idtcpclient1实现端口扫描器

Delphi检测android mock位置

Delphi xe mysql数据库操作类 mysqlhelper

Delphi 利用Delphi监视注册表的变化

Delphi 判断文件类型函数

Delphi 如何将颜色值转换为灰度颜色值?

Delphi android实例-红外线操作(xe10.2+小米5)

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



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...