function FindBitmap(subbmp, bmp: TBitmap): TPoint; var x, y, x1, y1: Integer; pmatch: boolean; begin result.x := -1; result.y := -1; for x := 0 to bmp.width-subbmp.width-1 do for y := 0 to bmp.height-subbmp.height-1 do if bmp.Canvas.Pixels[x, y]=subbmp.Canvas.Pixels[0, 0] then begin pmatch := true; for x1 := 0 to subbmp.width-1 do begin for y1 := 0 to subbmp.height-1 do if not(bmp.Canvas.Pixels[x+x1, y+y1]=subbmp.Canvas.Pixels[x1, y1]) then begin pmatch := false; break; end; if not pmatch then break end; if pmatch then begin result.x := x; result.y := y; exit; end; end; end;
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.