Hi all,
i need to load a jpeg/png image into a string to be then passed to another function that encode it in base64 and send via the tcp, but i can't figure out of how to made it, this my current code:
MyImage: String;
MyImageStream: TFileStream;
TheSize: Integer;
begin
try
if FileExists(TrimFilename(FAppPath + ROOT_SKIN + 'image.jpg')) then
begin
MyImageStream := TFileStream.Create(FAppPath + ROOT_SKIN + 'image.jpg', fmOpenRead);
SetLength(MyImage, MyImageStream.Size);
//TheSize := MyImageStream.Size;
MyImageStream.Read(MyImage, MyImageStream.Size);
end;
what's wrong? after the .Read whatever code is crashing...