Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#5

Re: Scanline Schleife sehr langsam!?

  Alt 15. Sep 2008, 14:26
Hi,

Folgendes geht bei mir ziemlich schnell:

Delphi-Quellcode:
procedure TForm1.Image1Click(Sender: TObject);
var i,j: Integer;
    p: PRGBQuad;
    bmp: TBitmap;
begin
  bmp := TBitmap.Create;
  try
    bmp.Assign(Image1.Picture.Bitmap);
    bmp.PixelFormat := pf32Bit;
    for i:= 0 to bmp.Height-1 do
    begin
      p := bmp.ScanLine[i];
      for j:= 0 to bmp.Width-1 do
      begin
        if PCardinal(p)^ = $00FF0000 then // farbe = clred, wobei clred <> $00FF0000. :stupid:
          ShowMessage('Rot gefunden');
        inc(p);
      end;
    end;
  finally
    bmp.Free;
  end;
end;
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat