mirror of https://github.com/quasar/Quasar.git
commit
4c0894dbb3
|
@ -232,6 +232,8 @@ public static void HandleRemoteDesktop(Packets.ServerPackets.Desktop command, Cl
|
||||||
LastDesktopScreenshot.PixelFormat);
|
LastDesktopScreenshot.PixelFormat);
|
||||||
|
|
||||||
using (MemoryStream stream = new MemoryStream())
|
using (MemoryStream stream = new MemoryStream())
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
StreamCodec.CodeImage(bmpdata.Scan0,
|
StreamCodec.CodeImage(bmpdata.Scan0,
|
||||||
new Rectangle(0, 0, LastDesktopScreenshot.Width, LastDesktopScreenshot.Height),
|
new Rectangle(0, 0, LastDesktopScreenshot.Width, LastDesktopScreenshot.Height),
|
||||||
|
@ -239,6 +241,12 @@ public static void HandleRemoteDesktop(Packets.ServerPackets.Desktop command, Cl
|
||||||
stream);
|
stream);
|
||||||
new Packets.ClientPackets.DesktopResponse(stream.ToArray(), StreamCodec.ImageQuality, StreamCodec.Monitor).Execute(client);
|
new Packets.ClientPackets.DesktopResponse(stream.ToArray(), StreamCodec.ImageQuality, StreamCodec.Monitor).Execute(client);
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
new Packets.ClientPackets.DesktopResponse(null, StreamCodec.ImageQuality, StreamCodec.Monitor).Execute(client);
|
||||||
|
StreamCodec = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LastDesktopScreenshot.UnlockBits(bmpdata);
|
LastDesktopScreenshot.UnlockBits(bmpdata);
|
||||||
LastDesktopScreenshot.Dispose();
|
LastDesktopScreenshot.Dispose();
|
||||||
|
|
|
@ -111,6 +111,24 @@ public static void HandleRemoteDesktopResponse(Client client, DesktopResponse pa
|
||||||
if (client.Value.FrmRdp == null)
|
if (client.Value.FrmRdp == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (packet.Image == null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
client.Value.FrmRdp.Invoke((MethodInvoker)delegate
|
||||||
|
{
|
||||||
|
client.Value.FrmRdp.picDesktop.Image = (Bitmap)client.Value.LastDesktop;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
|
||||||
|
client.Value.LastDesktop = null;
|
||||||
|
client.Value.LastDesktopSeen = true;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// we can not dispose all bitmaps here, cause they are later used again in `client.Value.LastDesktop`
|
// we can not dispose all bitmaps here, cause they are later used again in `client.Value.LastDesktop`
|
||||||
if (client.Value.LastDesktop == null)
|
if (client.Value.LastDesktop == null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue