Thanks for your help.
Now my app works well: the client asks the server for an image and this returns the data correctly. But there is a curious behaviour. The picture received is scaled correctly if the client is connected to the local server. With the remote server, the image control doesn't scale correctly.
I don't know why this is. The code is the same.
Is this from the browser? Inspect the network request executed by the browser in both situations and check if the response is exactly the same (at least same content length, etc.) Maybe the metafile you are providing is different?
Other than this, if everything is 100% sure to be the same, it's something at your client side.
Setting the Timage autosize property to true, the Timage control changes its bounds accordingly with the size of geometry and shows completely the figure
(localhost). When I go on online the image is truncated. So the data sent from the data server online are incomplete. I don't know why.
I understood where is the problem.
Since I extract the image from a container file and call some Windows routines that concern the metafiles and since these are two different versions of Windows, on the online PC (Windows 2022 server) the result is not as expected (the file is corrupt).