I wonder if it´s possible to take a screenshot, and only keep it IF it is different from the last one.
so currently i am using this function.
private static MemoryStream PrintWindow(string prcname)
{
IntPtr hwnd;
using (var proc = Process.GetProcessesByName(prcname)[0])
{
hwnd = proc.MainWindowHandle;
}
Rect rc;
NativeMethods.GetWindowRect(hwnd, out rc);
using (Bitmap bmp = new Bitmap(rc.Width, rc.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb))
{
using (Graphics gfxBmp = Graphics.FromImage(bmp))
{
IntPtr hdcBitmap = gfxBmp.GetHdc();
try
{
NativeMethods.PrintWindow(hwnd, hdcBitmap, 0);
}
finally
{
gfxBmp.ReleaseHdc(hdcBitmap);
}
}
MemoryStream ms = new MemoryStream();
bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
return ms;
}
}
And then i send the image over the net and display it on the other side.
Now, i wonder if it´s possible to just send when a new image has been taking. or well, not new, but another image. Let´s say it takes 10 images, and all of them looks exactly the same, and it´s just unnecessary to use all of those 10 images and send them, as the the other side could just "pause" at that last image until a new image has occured.
Hope you understand what i am trying to explain here.