Thema: Delphi Bilder Verschlüsseln

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
 
#12

Re: Bilder Verschlüsseln

  Alt 28. Apr 2009, 11:14
Also falls du die Methode von corpsman verwenden willst, ist hier eine schnellere:

Delphi-Quellcode:
procedure XorBitmapData(ABitmap: TBitmap; Key: Byte);
var p: PRGBQuad;
    i,j: Integer;
begin
  ABitmap.Pixelformat := pf32Bit;
  for i := 0 to ABitmap.Height-1 do
  begin
    p := ABitmap.Scanline[i]; //(Kann auch Scanline(i) sein... weiß grad nicht)
    for j := 0 to ABitmap.Width-1 do
    begin
      PCardinal(p)^ := PCardinal(p)^ xor Key;
      inc(p);
    end;
  end;
  ABitmap.Pixelformat := pf24Bit;
end;
Ich hoffe das der Code so läuft. Hab grad kein Delphi hier. Kann sein, dass du die eigenen Farb-Bytes einzeln verschlüsseln musst.
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