aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Experiments/Tango.RemoteDesktop
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-04 14:09:45 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-04 14:09:45 +0200
commit565e48de649d3d14e6b82012b6aa2e3819a3c82c (patch)
tree16e766f6bd45e62c48d6046a21841526aafaed73 /Software/Experiments/Tango.RemoteDesktop
parentb0ccae10fa6025838195c42fa6c9dd72b4321579 (diff)
downloadTango-565e48de649d3d14e6b82012b6aa2e3819a3c82c.tar.gz
Tango-565e48de649d3d14e6b82012b6aa2e3819a3c82c.zip
Improved BitmapCliper.
Implemented auto throw when max differences reached. Implemented fallback TurboJpeg encoder. Fixed issue with UpdateMachine.xml script removing DISPENSERS before IDS_PACKS. Added GlobalHost.Configuration.MaxIncomingWebSocketMessageSize for WebSockets support for large messages on SignalR.
Diffstat (limited to 'Software/Experiments/Tango.RemoteDesktop')
-rw-r--r--Software/Experiments/Tango.RemoteDesktop/Tango.RemoteDesktop/Clipping/BitmapCliper.cs16
-rw-r--r--Software/Experiments/Tango.RemoteDesktop/WpfApp1/MainWindow.xaml.cs2
2 files changed, 8 insertions, 10 deletions
diff --git a/Software/Experiments/Tango.RemoteDesktop/Tango.RemoteDesktop/Clipping/BitmapCliper.cs b/Software/Experiments/Tango.RemoteDesktop/Tango.RemoteDesktop/Clipping/BitmapCliper.cs
index 5bd8beaa3..5bfec8612 100644
--- a/Software/Experiments/Tango.RemoteDesktop/Tango.RemoteDesktop/Clipping/BitmapCliper.cs
+++ b/Software/Experiments/Tango.RemoteDesktop/Tango.RemoteDesktop/Clipping/BitmapCliper.cs
@@ -30,8 +30,7 @@ namespace Tango.RemoteDesktop.Clipping
//determine top
for (int i = 0; i < rgbValues.Length; i++)
{
- int color = rgbValues[i] & 0xffffff;
- if (color != 0x0)
+ if (rgbValues[i] != 16777215)
{
int r = i / bd.Width;
int c = i % bd.Width;
@@ -53,8 +52,7 @@ namespace Tango.RemoteDesktop.Clipping
//determine bottom
for (int i = rgbValues.Length - 1; i >= 0; i--)
{
- int color = rgbValues[i] & 0xffffff;
- if (color != 0x0)
+ if (rgbValues[i] != 16777215)
{
int r = i / bd.Width;
int c = i % bd.Width;
@@ -79,8 +77,7 @@ namespace Tango.RemoteDesktop.Clipping
//determine left
for (int c = 0; c < left; c++)
{
- int color = rgbValues[r * bd.Width + c] & 0xffffff;
- if (color != 0x0)
+ if (rgbValues[r * bd.Width + c] != 16777215)
{
if (left > c)
{
@@ -93,8 +90,7 @@ namespace Tango.RemoteDesktop.Clipping
//determine right
for (int c = bd.Width - 1; c > right; c--)
{
- int color = rgbValues[r * bd.Width + c] & 0xffffff;
- if (color != 0x0)
+ if (rgbValues[r * bd.Width + c] != 16777215)
{
if (right < c)
{
@@ -128,7 +124,9 @@ namespace Tango.RemoteDesktop.Clipping
//create new image
Bitmap newImage = new Bitmap(width, height, PixelFormat.Format32bppArgb);
- BitmapData nbd = newImage.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
+ BitmapData nbd
+ = newImage.LockBits(new Rectangle(0, 0, width, height),
+ ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
Marshal.Copy(imgData, 0, nbd.Scan0, imgData.Length);
newImage.UnlockBits(nbd);
diff --git a/Software/Experiments/Tango.RemoteDesktop/WpfApp1/MainWindow.xaml.cs b/Software/Experiments/Tango.RemoteDesktop/WpfApp1/MainWindow.xaml.cs
index 7953e9666..ec0cd852a 100644
--- a/Software/Experiments/Tango.RemoteDesktop/WpfApp1/MainWindow.xaml.cs
+++ b/Software/Experiments/Tango.RemoteDesktop/WpfApp1/MainWindow.xaml.cs
@@ -40,7 +40,7 @@ namespace WpfApp1
_engine = new RasterScreenCaptureEngine()
{
- CaptureRegion = new CaptureRegion(1920 + 1920, 0, 1280, 800)
+ CaptureRegion = new CaptureRegion(0, 0, 1280, 800)
};
_engine.CaptureMethod = new GdiScreenCapture();
_engine.FrameRate = 5; //Per second