[Mono-dev] Bitmap return type remoting problem

Sebastien Pouliot sebastien.pouliot at gmail.com
Wed Nov 21 17:09:21 EST 2007

On Wed, 2007-11-21 at 18:01 -0300, buhochileno at gmail.com wrote:
> Hi:
> I have a class (with the corrsponding interface) that have a method with 
> a Bitmap as a return type, something like:
> class c
> {
>     Bitmap GetLastFrame()
>     {
>              return new Bitmap("/tmp/baboon.jpg");
>     }
> }
> I'm able to register the object with remoting and call other method, 
> properties, etc, but when I call the "GetLastFrame" method I get a "Null 
> or Invalid object value....", if I call the method without remoting all 
> work ok, but when I make the call from a client with remoting I get this 
> problem, ofcourse the "/tmp/baboon.jpg" file exist on the remoting 
> server....
> any sugestion?.

Yes, don't remote it.

Seriously Bitmap may be serializable but :
* it is probably (98%) not compatible with MS;
* you would be serializing a lot of data since the Bitmap is
uncompressed where the original JPEG file was much smaller

so return a (much smaller) stream/byte[] and rebuild the Bitmap on the
client side.


More information about the Mono-devel-list mailing list