Moin,
vielleicht funktioniert es besser, wenn du es so versuchst:
Delphi-Quellcode:
procedure TDemoForm.Test;
var
s: TStream;
bmp: TBitmap;
jpg: TJpegImage;
begin
s := TMemoryStream.Create;
jpg := TJpegImage.Create;
bmp := TBitmap.Create;
try
bmp.Assign(Image.Picture.Bitmap);
jpg.CompressionQuality := 80;
jpg.Assign(bmp);
jpg.SaveToStream(s);
with TCPClient do
begin
OpenWriteBuffer;
try
WriteStream(s, True, True);
CloseWriteBuffer;
except
CancelWriteBuffer;
raise;
end;
end;
finally
jpg.Free;
bmp.Free;
s.Free;
end;
end;
Getippt und nicht getestet.
Grüße vom marabu