Thanks for the reply. The code I used to load the image into a byte array on the server side is shown below.
if (str == "screen/")
{
int screenWidth = Screen.GetBounds(new Point(0, 0)).Width;
int screenHeight = Screen.GetBounds(new Point(0, 0)).Height;
Bitmap bmpScreenShot = new Bitmap(screenWidth, screenHeight);
Graphics gfx = Graphics.FromImage((Image)bmpScreenShot);
gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight));
{
try
{
using (MemoryStream ms = new MemoryStream())
{
bmpScreenShot.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] array = ms.ToArray();
server.Send(array);
}
}
If I use those same code snippets all in a single windows form without sending through a socket and to a client it works fine. So im assuming it has something to do with the transfer between server to client. Help is greatly appriciated. Thank you.