Tim,
With a Bitmap, you can call the Save method on it to write to a Stream.
I would pass a MemoryStream to this method, and then extract the byte array
from the memory stream, sending that across the remoting boundary.
Then, on the other side, when you get the byte array, you can call the
static FromStream method on the Image class to get an instance of Image that
you can probably cast to Bitmap (depending on whether the underlying
representation was Bitmap or a Metafile).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
ni**************@exisconsulting.com
"Tim Shih" <ts***@sensicast.com> wrote in message
news:e8****************@TK2MSFTNGP12.phx.gbl...
Hi, I'm looking for a way to remotely pass bitmaps and soundfiles via
remoting. I have a class which contains a bitmap and I can easily access it
remotely as long as I do not set a value for the bitmap. However, when i
specify a value for the bitmap I get the 'Because of security restrictions,
the type System.Runtime.Remoting.ObjRef cannot be accessed.' message. Now, I
attempted to inherit from Bitmap to make it serializable but I am unable to
inherit from that class. If anyone knows how to serialize a bitmap across
the remoting boundary, your help would be greatly appreciated!
Thanks,
Tim