Hello Nigel,
I tried as per your suggestions and managed to save file properly but now I am not able to reload the file in ImageEN.
I have placed two components on Form - CryptographicLibrary1 and Codec1. I conneced both by setting Codec1's CryptoLibrary property to CryptographicLibrary1.
Here is the code to save file that seems to work:
var
fsPlain: TMemoryStream;
fsChiper: TFileStream;
...
Codec1.Reset;
Codec1.Password := '5961414C4C4148';
fsPlain := TMemoryStream.Create();
fsChiper := TFileStream.Create(SaveDialog1.FileName, fmCreate);
Child.ImageEnView1.LayersSaveToStream(fsPlain, -1);
Codec1.EncryptStream(fsPlain, fsChiper);
fsChiper.Free;
fsPlain.Free;
While the code to Load file is:
var
fsPlain: TMemoryStream;
fsChiper: TFileStream;
...
Codec1.Reset;
Codec1.Password := '5961414C4C4148';
fsPlain := TMemoryStream.Create();
fsChiper := TFileStream.Create(Name, fmOpenRead);
Codec1.DecryptStream(fsPlain, fsChiper);
Child.ImageEnView1.LayersLoadFromStream(fsPlain);
fsChiper.Free;
fsPlain.Free;
Please guide me here.
TIA
Yogi Yang
Yogi Yang