I found shortly after posting this question that BinaryFormatter's Serialize/Deserialize has a System.Runtime.Remoting.Messaging.Headers[]
parameter. I was able to effectively process the data like so:
Client:
Rectangle bounds = Rectangle.Empty;
Bitmap image = Utils.Screen(ref bounds);
BinaryFormatter bFormat = new BinaryFormatter();
Header[] headers = { new Header("bounds", bounds) };
bFormat.Serialize(stream, image, headers);
Server:
BinaryFormatter bFormat = new BinaryFormatter();
Rectangle bounds = new Rectangle();
Bitmap inImage = bFormat.Deserialize
(
stream,
headers =>
{
foreach(var header in headers)
{
if(header.Name == "bounds")
bounds = (Rectangle)header.Value;
}
return null;
}
) as Bitmap;