How to pass a bitmap from a Delphi client to a C# server

Hello,

I need to pass an image (a person’s signature) from my Delphi application to a C# server. My expectation is that I will use a Binary parameter in the method call. How should I save the image to the stream in Delphi and load it from the stream in C#?

Thank you,
Brian Wheatley

delphi-side:

Binary is descendant of TMemoryStream, so you can use their methods.

for saving image to binary you can use:

  //stream: binary
  //image: TJPEGImage
  image.SaveToStream(stream);

for loading image from file:

  //stream: binary
  stream.LoadFromFile(filename); 

Brian,

essentially, what you’ll wanna do is focus on a specific image format that you want to pass (say PNG, or JPEG, depending on your needs). Then use the platforms’ specific APIs in Delphi and .NEt respectively to load/save that image format from/to binary blob, and send that binary data via your RO service.