Delphi-Quellcode:
function BitmapToString(b: TBitmap): String;
var ms: TMemoryStream;
a: Int64;
i:integer;
buffer: Array[0..1024] of Byte;
begin
result := '';
ms := TMemoryStream.Create;
try
b.SaveToStream(ms);
ms.Position:=0;
a := 1;
while a <> 0 do
begin
a := ms.read(buffer[0], length(buffer));
for i := 0 to a-1 do
begin
result := result + IntToHex(buffer[i], 2);
end;
end;
finally
ms.Free;
end;
end;
function StringToBitmap(Input:string):TBitmap;
var
P:TMemoryStream;
I:integer;
B:Byte;
begin
P:=TMemoryStream.Create;
I:=1;
while(I<=Length(Input))do
begin
B:=StrToInt('$'+copy(Input, I, 2));
P.Write(B, 1);
inc(I, 2);
end;
P.Position:=0;
Result:=TBitmap.Create;
Result.LoadFromStream(P);
P.Free;
end;
Das geht genauso wie deins, Deddy
Gelöst!
Thx vom LDer!