habe es jetzt so gemacht wie oben
speichern
Delphi-Quellcode:
var
i,m : integer;
file_device_info : File of TNetDeviceInfo;
s : TMemoryStream;
b : byte;
begin
AssignFile(file_device_info,'test.dat');
for i:=0 to NetStruktur.Devices.Count-1 do begin
s := TMemoryStream.Create;
device_info := pNetDeviceInfo(NetStruktur.Devices.Objects[i]);
device_info.fDesigner.fBitmap.SaveToStream(s);
for m:=0 to device_info.fDesigner.fBitmapLength -1 do
begin
s.Read(b,1);
device_info.fDesigner.fBitmapArray[m] := b;
end;
Write(file_device_info,device_info);
s.free;
end;
CloseFile(file_device_info);
end;
das laden
Delphi-Quellcode:
var
file_device_info : File of TNetDeviceInfo;
b : Byte;
m : TMemoryStream;
begin
AssignFile(file_device_info,'test.dat');
Reset(file_device_info);
while not eof(file_device_info) do
begin
device_info := NetStruktur.CreateNewDevice;
m := TMemoryStream.Create;
Read(file_device_info,device_info);
for i:=0 to device_info.fDesigner.fBitmapLength - 1 do
begin
b := device_info.fDesigner.fBitmapArray[i];
m.Write(b,1);
end;
device_info.fDesigner.fBitmap.LoadFromStream(m);
m.Free;
end;
CloseFile(file_device_info);
end;
nur wenn ich das bild speicher ist das bild leer.
Aber in fBitmapArray stehen zahlen
Habe ich was falsch gemacht?