Einzelnen Beitrag anzeigen

nahpets
(Gast)

n/a Beiträge
 
#6

AW: External: SIGEGV bei Rect()

  Alt 6. Dez 2016, 22:27
Wo steht denn jetzt das Create, immer noch hinter der vom Debugger bemängelten Zeile?

Ohne Gewähr für irgendwas:
Delphi-Quellcode:
begin
  img := TImage.Create;
  kanten := TImage.Create;
  blaueflaeche := TImage.Create;
  filterRad := 3;
  durchschnitt := (filterRad * 2) - 1;
  img.LoadFromFile(Pfad);
  DstRect := Rect(0, 0, img.Width, img.Height);
  kanten.setSize(img.Width, img.Height);
  blaueflaeche.setSize(img.Width, img.Height);
  kanten := findeKanten(img, filterRad, 200, kanten); // <- wie sieht denn diese Funktion aus, was hat sie für 'nen Rückgabewert?
  blaueflaeche := findeBlau(img, filterRad, blaueflaeche);
  for x := filterRad to img.Width - filterRad - 1 do
  begin
    for y := filterRad to img.Height - filterRad - 1 do
    begin
      if (isObenLinks(kanten, x, y, 3) AND hatBlaueFlaeche(blaueflaeche, x, y, 3)) then
      begin
        SrcRect := Rect(x, y, 300, 200);
        Result.Canvas.CopyMode := cmSrcCopy;
        Result.Canvas.CopyRect(dstRect, img.Canvas, SrcRect);
        break;
      end;
    end;
  end;
  FreeAndNil(img);
  FreeAndNil(kanten);
  FreeAndNil(blaueflaeche);
end;
  Mit Zitat antworten Zitat