Einzelnen Beitrag anzeigen

Benutzerbild von Bernhard Geyer
Bernhard Geyer

Registriert seit: 13. Aug 2002
17.171 Beiträge
 
Delphi 10.4 Sydney
 
#12

AW: Funktion/Komponente gesucht S/W-Bilder mit Rasterung erzeugen kann

  Alt 31. Jul 2012, 11:42
Die Funktion Floyd_Steinberg muss noch besser die Grenzen abprüfen. Sonst kracht es am Ende des Bildes ...

Die Abfragen mit if x < BMP.Width - 1 then wurden ergänzt

Delphi-Quellcode:
      if x < BMP.Width - 1 then
        FastPixel(BMP, CArray, x + 1, y, ApplyError(FastPixel(BMP, CArray, x + 1, y), error, 7));

      if y < BMP.Height - 1 then
      begin
        if x > 0 then
          FastPixel(BMP, CArray, x - 1, y + 1, ApplyError(FastPixel(BMP, CArray, x - 1, y + 1), error, 3));

        FastPixel(BMP, CArray, x, y + 1, ApplyError(FastPixel(BMP, CArray, x, y + 1), error, 5));
        
        if x < BMP.Width - 1 then
          FastPixel(BMP, CArray, x + 1, y + 1, ApplyError(FastPixel(BMP, CArray, x + 1, y + 1), error, 1));
      end;
Windows Vista - Eine neue Erfahrung in Fehlern.
  Mit Zitat antworten Zitat