تبليغاتX
آموزش دلفی و پاسخ به پرسشهای شما در دلفی -
 
آموزش دلفی و نکات برنامه نویسی و پاسخ به پرسشهای شما در زمینه برنامه نویسی
 
کدی برای مقایسه دو تصویر بیت مپ

function compareBmp(Bmp1, Bmp2: TBitmap): Boolean;
var y,x: Integer;
     P1, P2: PByteArray;
begin
    Result := False;
    if Bmp1.WIdth <> Bmp2.Width then Exit;
    if Bmp1.Height <> Bmp2.Height then Exit;
    if Bmp1.PixelFormat <> Bmp2.PixelFormat then Exit;
    for y := 0 to Bmp1.Height - 1 do
    begin
        P1 := PByteArray(Bmp1.Scanline);
        P2 := PByteArray(Bmp2.Scanline);
        for x := 0 to Bmp1.Width -1 do
            if P1[x] <> P2[x] then Exit;
    end;
    Result := True;
end;

  نوشته شده در  پنجشنبه هجدهم خرداد 1385ساعت 15:13  توسط مرد تنها  | 
 
  POWERED BY BLOGFA.COM