Find scanline in scanline
I want to compare/find the scanline from a smaller bitmap which each position of a scanline of a widhter image. I thought that I could offset the pointer to BitMap2.ScanLine[i] by a numeric offset.
But I get an error that the operand is not valid.
Any better idea?
But I get an error that the operand is not valid.
- Code: Select all
BitMap1.PixelFormat := pf24bit;
BitMap2.PixelFormat := pf24bit;
L := BitMap1.Width * 3;
For i := 0 to BitMap2.Height - 1 do
begin
for x := 0 to BitMap2.width - BitMap1.width -1 do
If CompareMem(BitMap1.ScanLine[0], BitMap2.ScanLine[i] + x * 3, L) Then
Inc(W);
end;
Any better idea?