Adding option to reverse screen. That's useful to avoid having to set our
authorsl
Mon, 11 Aug 2014 23:18:45 +0200
changeset 16985ca4b6e099
parent 15 452e5c0c98da
child 17 19c1aaf900dc
Adding option to reverse screen. That's useful to avoid having to set our
hardware the correct way up.
App.config
MainForm.Designer.cs
MainForm.cs
Properties/Settings.Designer.cs
Properties/Settings.settings
SharpDisplayManager.csproj
     1.1 --- a/App.config	Tue Aug 05 22:11:08 2014 +0200
     1.2 +++ b/App.config	Mon Aug 11 23:18:45 2014 +0200
     1.3 @@ -22,6 +22,9 @@
     1.4              <setting name="DisplayConnectOnStartup" serializeAs="String">
     1.5                  <value>False</value>
     1.6              </setting>
     1.7 +            <setting name="DisplayReverseScreen" serializeAs="String">
     1.8 +                <value>False</value>
     1.9 +            </setting>
    1.10          </SharpDisplayManager.Properties.Settings>
    1.11      </userSettings>
    1.12  </configuration>
    1.13 \ No newline at end of file
     2.1 --- a/MainForm.Designer.cs	Tue Aug 05 22:11:08 2014 +0200
     2.2 +++ b/MainForm.Designer.cs	Mon Aug 11 23:18:45 2014 +0200
     2.3 @@ -31,6 +31,12 @@
     2.4              this.components = new System.ComponentModel.Container();
     2.5              this.tabControl = new System.Windows.Forms.TabControl();
     2.6              this.tabPageDisplay = new System.Windows.Forms.TabPage();
     2.7 +            this.checkBoxReverseScreen = new System.Windows.Forms.CheckBox();
     2.8 +            this.checkBoxConnectOnStartup = new System.Windows.Forms.CheckBox();
     2.9 +            this.panelDisplay = new System.Windows.Forms.Panel();
    2.10 +            this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
    2.11 +            this.marqueeLabelTop = new SharpDisplayManager.MarqueeLabel();
    2.12 +            this.marqueeLabelBottom = new SharpDisplayManager.MarqueeLabel();
    2.13              this.checkBoxShowBorders = new System.Windows.Forms.CheckBox();
    2.14              this.trackBarBrightness = new System.Windows.Forms.TrackBar();
    2.15              this.buttonFill = new System.Windows.Forms.Button();
    2.16 @@ -47,17 +53,12 @@
    2.17              this.toolStripStatusLabelSpring = new System.Windows.Forms.ToolStripStatusLabel();
    2.18              this.toolStripStatusLabelPower = new System.Windows.Forms.ToolStripStatusLabel();
    2.19              this.toolStripStatusLabelFps = new System.Windows.Forms.ToolStripStatusLabel();
    2.20 -            this.panelDisplay = new System.Windows.Forms.Panel();
    2.21 -            this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
    2.22 -            this.checkBoxConnectOnStartup = new System.Windows.Forms.CheckBox();
    2.23 -            this.marqueeLabelTop = new SharpDisplayManager.MarqueeLabel();
    2.24 -            this.marqueeLabelBottom = new SharpDisplayManager.MarqueeLabel();
    2.25              this.tabControl.SuspendLayout();
    2.26              this.tabPageDisplay.SuspendLayout();
    2.27 +            this.panelDisplay.SuspendLayout();
    2.28 +            this.tableLayoutPanel.SuspendLayout();
    2.29              ((System.ComponentModel.ISupportInitialize)(this.trackBarBrightness)).BeginInit();
    2.30              this.statusStrip.SuspendLayout();
    2.31 -            this.panelDisplay.SuspendLayout();
    2.32 -            this.tableLayoutPanel.SuspendLayout();
    2.33              this.SuspendLayout();
    2.34              // 
    2.35              // tabControl
    2.36 @@ -75,6 +76,7 @@
    2.37              // 
    2.38              // tabPageDisplay
    2.39              // 
    2.40 +            this.tabPageDisplay.Controls.Add(this.checkBoxReverseScreen);
    2.41              this.tabPageDisplay.Controls.Add(this.checkBoxConnectOnStartup);
    2.42              this.tabPageDisplay.Controls.Add(this.panelDisplay);
    2.43              this.tabPageDisplay.Controls.Add(this.checkBoxShowBorders);
    2.44 @@ -93,6 +95,146 @@
    2.45              this.tabPageDisplay.Text = "Display";
    2.46              this.tabPageDisplay.UseVisualStyleBackColor = true;
    2.47              // 
    2.48 +            // checkBoxReverseScreen
    2.49 +            // 
    2.50 +            this.checkBoxReverseScreen.AutoSize = true;
    2.51 +            this.checkBoxReverseScreen.Location = new System.Drawing.Point(113, 298);
    2.52 +            this.checkBoxReverseScreen.Name = "checkBoxReverseScreen";
    2.53 +            this.checkBoxReverseScreen.Size = new System.Drawing.Size(101, 17);
    2.54 +            this.checkBoxReverseScreen.TabIndex = 14;
    2.55 +            this.checkBoxReverseScreen.Text = "Reverse screen";
    2.56 +            this.checkBoxReverseScreen.UseVisualStyleBackColor = true;
    2.57 +            this.checkBoxReverseScreen.CheckedChanged += new System.EventHandler(this.checkBoxReverseScreen_CheckedChanged);
    2.58 +            // 
    2.59 +            // checkBoxConnectOnStartup
    2.60 +            // 
    2.61 +            this.checkBoxConnectOnStartup.AutoSize = true;
    2.62 +            this.checkBoxConnectOnStartup.Location = new System.Drawing.Point(113, 321);
    2.63 +            this.checkBoxConnectOnStartup.Name = "checkBoxConnectOnStartup";
    2.64 +            this.checkBoxConnectOnStartup.Size = new System.Drawing.Size(119, 17);
    2.65 +            this.checkBoxConnectOnStartup.TabIndex = 13;
    2.66 +            this.checkBoxConnectOnStartup.Text = "Connect on stratup ";
    2.67 +            this.checkBoxConnectOnStartup.UseVisualStyleBackColor = true;
    2.68 +            this.checkBoxConnectOnStartup.CheckedChanged += new System.EventHandler(this.checkBoxConnectOnStartup_CheckedChanged);
    2.69 +            // 
    2.70 +            // panelDisplay
    2.71 +            // 
    2.72 +            this.panelDisplay.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
    2.73 +            this.panelDisplay.Controls.Add(this.tableLayoutPanel);
    2.74 +            this.panelDisplay.Location = new System.Drawing.Point(181, 151);
    2.75 +            this.panelDisplay.Margin = new System.Windows.Forms.Padding(0);
    2.76 +            this.panelDisplay.Name = "panelDisplay";
    2.77 +            this.panelDisplay.Size = new System.Drawing.Size(258, 66);
    2.78 +            this.panelDisplay.TabIndex = 12;
    2.79 +            // 
    2.80 +            // tableLayoutPanel
    2.81 +            // 
    2.82 +            this.tableLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    2.83 +            | System.Windows.Forms.AnchorStyles.Left) 
    2.84 +            | System.Windows.Forms.AnchorStyles.Right)));
    2.85 +            this.tableLayoutPanel.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
    2.86 +            this.tableLayoutPanel.ColumnCount = 1;
    2.87 +            this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
    2.88 +            this.tableLayoutPanel.Controls.Add(this.marqueeLabelTop, 0, 0);
    2.89 +            this.tableLayoutPanel.Controls.Add(this.marqueeLabelBottom, 0, 1);
    2.90 +            this.tableLayoutPanel.Location = new System.Drawing.Point(0, 0);
    2.91 +            this.tableLayoutPanel.Margin = new System.Windows.Forms.Padding(0);
    2.92 +            this.tableLayoutPanel.Name = "tableLayoutPanel";
    2.93 +            this.tableLayoutPanel.RowCount = 2;
    2.94 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
    2.95 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
    2.96 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
    2.97 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
    2.98 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
    2.99 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.100 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.101 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.102 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.103 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.104 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.105 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.106 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.107 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.108 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.109 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.110 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.111 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.112 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.113 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.114 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.115 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.116 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.117 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.118 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.119 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.120 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.121 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.122 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.123 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.124 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.125 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.126 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.127 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.128 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.129 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.130 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.131 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.132 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.133 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.134 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.135 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.136 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.137 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.138 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.139 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.140 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.141 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.142 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.143 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.144 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.145 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.146 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.147 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.148 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.149 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.150 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.151 +            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.152 +            this.tableLayoutPanel.Size = new System.Drawing.Size(256, 64);
   2.153 +            this.tableLayoutPanel.TabIndex = 5;
   2.154 +            // 
   2.155 +            // marqueeLabelTop
   2.156 +            // 
   2.157 +            this.marqueeLabelTop.AutoEllipsis = true;
   2.158 +            this.marqueeLabelTop.BackColor = System.Drawing.Color.Transparent;
   2.159 +            this.marqueeLabelTop.Dock = System.Windows.Forms.DockStyle.Fill;
   2.160 +            this.marqueeLabelTop.Location = new System.Drawing.Point(1, 1);
   2.161 +            this.marqueeLabelTop.Margin = new System.Windows.Forms.Padding(0);
   2.162 +            this.marqueeLabelTop.Name = "marqueeLabelTop";
   2.163 +            this.marqueeLabelTop.OwnTimer = false;
   2.164 +            this.marqueeLabelTop.PixelsPerSecond = 64;
   2.165 +            this.marqueeLabelTop.Separator = "|";
   2.166 +            this.marqueeLabelTop.Size = new System.Drawing.Size(254, 30);
   2.167 +            this.marqueeLabelTop.TabIndex = 2;
   2.168 +            this.marqueeLabelTop.Text = "ABCDEFGHIJKLMNOPQRST-0123456789";
   2.169 +            this.marqueeLabelTop.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
   2.170 +            this.marqueeLabelTop.UseCompatibleTextRendering = true;
   2.171 +            // 
   2.172 +            // marqueeLabelBottom
   2.173 +            // 
   2.174 +            this.marqueeLabelBottom.AutoEllipsis = true;
   2.175 +            this.marqueeLabelBottom.Dock = System.Windows.Forms.DockStyle.Fill;
   2.176 +            this.marqueeLabelBottom.Location = new System.Drawing.Point(1, 32);
   2.177 +            this.marqueeLabelBottom.Margin = new System.Windows.Forms.Padding(0);
   2.178 +            this.marqueeLabelBottom.Name = "marqueeLabelBottom";
   2.179 +            this.marqueeLabelBottom.OwnTimer = false;
   2.180 +            this.marqueeLabelBottom.PixelsPerSecond = 64;
   2.181 +            this.marqueeLabelBottom.Separator = null;
   2.182 +            this.marqueeLabelBottom.Size = new System.Drawing.Size(254, 31);
   2.183 +            this.marqueeLabelBottom.TabIndex = 3;
   2.184 +            this.marqueeLabelBottom.Text = "abcdefghijklmnopqrst-0123456789";
   2.185 +            this.marqueeLabelBottom.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
   2.186 +            this.marqueeLabelBottom.UseCompatibleTextRendering = true;
   2.187 +            // 
   2.188              // checkBoxShowBorders
   2.189              // 
   2.190              this.checkBoxShowBorders.AutoSize = true;
   2.191 @@ -233,135 +375,6 @@
   2.192              this.toolStripStatusLabelFps.Size = new System.Drawing.Size(26, 17);
   2.193              this.toolStripStatusLabelFps.Text = "FPS";
   2.194              // 
   2.195 -            // panelDisplay
   2.196 -            // 
   2.197 -            this.panelDisplay.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
   2.198 -            this.panelDisplay.Controls.Add(this.tableLayoutPanel);
   2.199 -            this.panelDisplay.Location = new System.Drawing.Point(181, 151);
   2.200 -            this.panelDisplay.Margin = new System.Windows.Forms.Padding(0);
   2.201 -            this.panelDisplay.Name = "panelDisplay";
   2.202 -            this.panelDisplay.Size = new System.Drawing.Size(258, 66);
   2.203 -            this.panelDisplay.TabIndex = 12;
   2.204 -            // 
   2.205 -            // tableLayoutPanel
   2.206 -            // 
   2.207 -            this.tableLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
   2.208 -            | System.Windows.Forms.AnchorStyles.Left) 
   2.209 -            | System.Windows.Forms.AnchorStyles.Right)));
   2.210 -            this.tableLayoutPanel.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
   2.211 -            this.tableLayoutPanel.ColumnCount = 1;
   2.212 -            this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
   2.213 -            this.tableLayoutPanel.Controls.Add(this.marqueeLabelTop, 0, 0);
   2.214 -            this.tableLayoutPanel.Controls.Add(this.marqueeLabelBottom, 0, 1);
   2.215 -            this.tableLayoutPanel.Location = new System.Drawing.Point(0, 0);
   2.216 -            this.tableLayoutPanel.Margin = new System.Windows.Forms.Padding(0);
   2.217 -            this.tableLayoutPanel.Name = "tableLayoutPanel";
   2.218 -            this.tableLayoutPanel.RowCount = 2;
   2.219 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
   2.220 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
   2.221 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.222 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.223 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.224 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.225 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.226 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.227 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.228 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.229 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.230 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.231 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.232 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.233 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.234 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.235 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.236 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.237 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.238 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.239 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.240 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.241 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.242 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.243 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.244 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.245 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.246 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.247 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.248 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.249 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.250 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.251 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.252 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.253 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.254 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.255 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.256 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.257 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.258 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.259 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.260 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.261 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.262 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.263 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.264 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.265 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.266 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.267 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.268 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.269 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.270 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.271 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.272 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.273 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.274 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.275 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.276 -            this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
   2.277 -            this.tableLayoutPanel.Size = new System.Drawing.Size(256, 64);
   2.278 -            this.tableLayoutPanel.TabIndex = 5;
   2.279 -            // 
   2.280 -            // checkBoxConnectOnStartup
   2.281 -            // 
   2.282 -            this.checkBoxConnectOnStartup.AutoSize = true;
   2.283 -            this.checkBoxConnectOnStartup.Location = new System.Drawing.Point(113, 321);
   2.284 -            this.checkBoxConnectOnStartup.Name = "checkBoxConnectOnStartup";
   2.285 -            this.checkBoxConnectOnStartup.Size = new System.Drawing.Size(119, 17);
   2.286 -            this.checkBoxConnectOnStartup.TabIndex = 13;
   2.287 -            this.checkBoxConnectOnStartup.Text = "Connect on stratup ";
   2.288 -            this.checkBoxConnectOnStartup.UseVisualStyleBackColor = true;
   2.289 -            this.checkBoxConnectOnStartup.CheckedChanged += new System.EventHandler(this.checkBoxConnectOnStartup_CheckedChanged);
   2.290 -            // 
   2.291 -            // marqueeLabelTop
   2.292 -            // 
   2.293 -            this.marqueeLabelTop.AutoEllipsis = true;
   2.294 -            this.marqueeLabelTop.BackColor = System.Drawing.Color.Transparent;
   2.295 -            this.marqueeLabelTop.Dock = System.Windows.Forms.DockStyle.Fill;
   2.296 -            this.marqueeLabelTop.Location = new System.Drawing.Point(1, -901);
   2.297 -            this.marqueeLabelTop.Margin = new System.Windows.Forms.Padding(0);
   2.298 -            this.marqueeLabelTop.Name = "marqueeLabelTop";
   2.299 -            this.marqueeLabelTop.OwnTimer = false;
   2.300 -            this.marqueeLabelTop.PixelsPerSecond = 64;
   2.301 -            this.marqueeLabelTop.Separator = "|";
   2.302 -            this.marqueeLabelTop.Size = new System.Drawing.Size(254, 20);
   2.303 -            this.marqueeLabelTop.TabIndex = 2;
   2.304 -            this.marqueeLabelTop.Text = "ABCDEFGHIJKLMNOPQRST-0123456789";
   2.305 -            this.marqueeLabelTop.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
   2.306 -            this.marqueeLabelTop.UseCompatibleTextRendering = true;
   2.307 -            // 
   2.308 -            // marqueeLabelBottom
   2.309 -            // 
   2.310 -            this.marqueeLabelBottom.AutoEllipsis = true;
   2.311 -            this.marqueeLabelBottom.Dock = System.Windows.Forms.DockStyle.Fill;
   2.312 -            this.marqueeLabelBottom.Location = new System.Drawing.Point(1, -481);
   2.313 -            this.marqueeLabelBottom.Margin = new System.Windows.Forms.Padding(0);
   2.314 -            this.marqueeLabelBottom.Name = "marqueeLabelBottom";
   2.315 -            this.marqueeLabelBottom.OwnTimer = false;
   2.316 -            this.marqueeLabelBottom.PixelsPerSecond = 64;
   2.317 -            this.marqueeLabelBottom.Separator = null;
   2.318 -            this.marqueeLabelBottom.Size = new System.Drawing.Size(254, 20);
   2.319 -            this.marqueeLabelBottom.TabIndex = 3;
   2.320 -            this.marqueeLabelBottom.Text = "abcdefghijklmnopqrst-0123456789";
   2.321 -            this.marqueeLabelBottom.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
   2.322 -            this.marqueeLabelBottom.UseCompatibleTextRendering = true;
   2.323 -            // 
   2.324              // MainForm
   2.325              // 
   2.326              this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
   2.327 @@ -377,11 +390,11 @@
   2.328              this.tabControl.ResumeLayout(false);
   2.329              this.tabPageDisplay.ResumeLayout(false);
   2.330              this.tabPageDisplay.PerformLayout();
   2.331 +            this.panelDisplay.ResumeLayout(false);
   2.332 +            this.tableLayoutPanel.ResumeLayout(false);
   2.333              ((System.ComponentModel.ISupportInitialize)(this.trackBarBrightness)).EndInit();
   2.334              this.statusStrip.ResumeLayout(false);
   2.335              this.statusStrip.PerformLayout();
   2.336 -            this.panelDisplay.ResumeLayout(false);
   2.337 -            this.tableLayoutPanel.ResumeLayout(false);
   2.338              this.ResumeLayout(false);
   2.339              this.PerformLayout();
   2.340  
   2.341 @@ -412,6 +425,7 @@
   2.342          private MarqueeLabel marqueeLabelTop;
   2.343          private MarqueeLabel marqueeLabelBottom;
   2.344          private System.Windows.Forms.CheckBox checkBoxConnectOnStartup;
   2.345 +        private System.Windows.Forms.CheckBox checkBoxReverseScreen;
   2.346      }
   2.347  }
   2.348  
     3.1 --- a/MainForm.cs	Tue Aug 05 22:11:08 2014 +0200
     3.2 +++ b/MainForm.cs	Mon Aug 11 23:18:45 2014 +0200
     3.3 @@ -34,6 +34,7 @@
     3.4              marqueeLabelBottom.Font = Properties.Settings.Default.DisplayFont;
     3.5              checkBoxShowBorders.Checked = Properties.Settings.Default.DisplayShowBorders;
     3.6              checkBoxConnectOnStartup.Checked = Properties.Settings.Default.DisplayConnectOnStartup;
     3.7 +            checkBoxReverseScreen.Checked = Properties.Settings.Default.DisplayReverseScreen;
     3.8              //
     3.9              tableLayoutPanel.CellBorderStyle = (checkBoxShowBorders.Checked ? TableLayoutPanelCellBorderStyle.Single : TableLayoutPanelCellBorderStyle.None);
    3.10              //We have a bug when drawing minimized and reusing our bitmap
    3.11 @@ -139,6 +140,32 @@
    3.12              }
    3.13          }
    3.14  
    3.15 +
    3.16 +        public delegate int CoordinateTranslationDelegate(System.Drawing.Bitmap aBmp, int aInt);
    3.17 +
    3.18 +
    3.19 +        public static int ScreenReversedX(System.Drawing.Bitmap aBmp, int aX)
    3.20 +        {
    3.21 +            return aBmp.Width - aX - 1;
    3.22 +        }
    3.23 +
    3.24 +        public int ScreenReversedY(System.Drawing.Bitmap aBmp, int aY)
    3.25 +        {
    3.26 +            return iBmp.Height - aY - 1;
    3.27 +        }
    3.28 +
    3.29 +        public int ScreenX(System.Drawing.Bitmap aBmp, int aX)
    3.30 +        {
    3.31 +            return aX;
    3.32 +        }
    3.33 +
    3.34 +        public int ScreenY(System.Drawing.Bitmap aBmp, int aY)
    3.35 +        {
    3.36 +            return aY;
    3.37 +        }
    3.38 +
    3.39 +
    3.40 +        //This is our timer tick responsible to perform our render
    3.41          private void timer_Tick(object sender, EventArgs e)
    3.42          {
    3.43              //Update our animations
    3.44 @@ -159,9 +186,23 @@
    3.45                  }
    3.46                  tableLayoutPanel.DrawToBitmap(iBmp, tableLayoutPanel.ClientRectangle);
    3.47                  //iBmp.Save("D:\\capture.png");
    3.48 +
    3.49 +                //Select proper coordinate translation functions
    3.50 +                //We used delegate/function pointer to support reverse screen without doing an extra test on each pixels
    3.51 +                CoordinateTranslationDelegate screenX;
    3.52 +                CoordinateTranslationDelegate screenY;
    3.53 +
    3.54 +                if (Properties.Settings.Default.DisplayReverseScreen)
    3.55 +                {
    3.56 +                    screenX = ScreenReversedX;
    3.57 +                    screenY = ScreenReversedY;
    3.58 +                }
    3.59 +                else
    3.60 +                {
    3.61 +                    screenX = ScreenX;
    3.62 +                    screenY = ScreenY;
    3.63 +                }
    3.64                  
    3.65 -                //iBmp.
    3.66 -
    3.67                  //Send it to our display
    3.68                  for (int i = 0; i < iBmp.Width; i++)
    3.69                  {
    3.70 @@ -172,7 +213,7 @@
    3.71                              uint color = (uint)iBmp.GetPixel(i, j).ToArgb();
    3.72                              //For some reason when the app is minimized in the task bar only the alpha of our color is set.
    3.73                              //Thus that strange test for rendering to work both when the app is in the task bar and when it isn't.
    3.74 -                            iDisplay.SetPixel(i, j, Convert.ToInt32(!(color != 0xFF000000)));
    3.75 +                            iDisplay.SetPixel(screenX(iBmp, i), screenY(iBmp, j), Convert.ToInt32(!(color != 0xFF000000)));
    3.76                          }
    3.77                      }
    3.78                  }
    3.79 @@ -263,6 +304,7 @@
    3.80  
    3.81          private void checkBoxShowBorders_CheckedChanged(object sender, EventArgs e)
    3.82          {
    3.83 +            //Save our show borders setting
    3.84              tableLayoutPanel.CellBorderStyle = (checkBoxShowBorders.Checked ? TableLayoutPanelCellBorderStyle.Single : TableLayoutPanelCellBorderStyle.None);
    3.85              Properties.Settings.Default.DisplayShowBorders = checkBoxShowBorders.Checked;
    3.86              Properties.Settings.Default.Save();
    3.87 @@ -270,10 +312,18 @@
    3.88  
    3.89          private void checkBoxConnectOnStartup_CheckedChanged(object sender, EventArgs e)
    3.90          {
    3.91 +            //Save our connect on startup setting
    3.92              Properties.Settings.Default.DisplayConnectOnStartup = checkBoxConnectOnStartup.Checked;
    3.93              Properties.Settings.Default.Save();
    3.94          }
    3.95  
    3.96 +        private void checkBoxReverseScreen_CheckedChanged(object sender, EventArgs e)
    3.97 +        {
    3.98 +            //Save our reverse screen setting
    3.99 +            Properties.Settings.Default.DisplayReverseScreen = checkBoxReverseScreen.Checked;
   3.100 +            Properties.Settings.Default.Save();
   3.101 +        }
   3.102 +
   3.103          private void MainForm_Resize(object sender, EventArgs e)
   3.104          {
   3.105              if (WindowState == FormWindowState.Minimized)
     4.1 --- a/Properties/Settings.Designer.cs	Tue Aug 05 22:11:08 2014 +0200
     4.2 +++ b/Properties/Settings.Designer.cs	Mon Aug 11 23:18:45 2014 +0200
     4.3 @@ -70,5 +70,17 @@
     4.4                  this["DisplayConnectOnStartup"] = value;
     4.5              }
     4.6          }
     4.7 +        
     4.8 +        [global::System.Configuration.UserScopedSettingAttribute()]
     4.9 +        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    4.10 +        [global::System.Configuration.DefaultSettingValueAttribute("False")]
    4.11 +        public bool DisplayReverseScreen {
    4.12 +            get {
    4.13 +                return ((bool)(this["DisplayReverseScreen"]));
    4.14 +            }
    4.15 +            set {
    4.16 +                this["DisplayReverseScreen"] = value;
    4.17 +            }
    4.18 +        }
    4.19      }
    4.20  }
     5.1 --- a/Properties/Settings.settings	Tue Aug 05 22:11:08 2014 +0200
     5.2 +++ b/Properties/Settings.settings	Mon Aug 11 23:18:45 2014 +0200
     5.3 @@ -14,5 +14,8 @@
     5.4      <Setting Name="DisplayConnectOnStartup" Type="System.Boolean" Scope="User">
     5.5        <Value Profile="(Default)">False</Value>
     5.6      </Setting>
     5.7 +    <Setting Name="DisplayReverseScreen" Type="System.Boolean" Scope="User">
     5.8 +      <Value Profile="(Default)">False</Value>
     5.9 +    </Setting>
    5.10    </Settings>
    5.11  </SettingsFile>
    5.12 \ No newline at end of file
     6.1 --- a/SharpDisplayManager.csproj	Tue Aug 05 22:11:08 2014 +0200
     6.2 +++ b/SharpDisplayManager.csproj	Mon Aug 11 23:18:45 2014 +0200
     6.3 @@ -55,9 +55,7 @@
     6.4      <Compile Include="MainForm.Designer.cs">
     6.5        <DependentUpon>MainForm.cs</DependentUpon>
     6.6      </Compile>
     6.7 -    <Compile Include="MarqueeLabel.cs">
     6.8 -      <SubType>Component</SubType>
     6.9 -    </Compile>
    6.10 +    <Compile Include="MarqueeLabel.cs" />
    6.11      <Compile Include="Program.cs" />
    6.12      <Compile Include="Properties\AssemblyInfo.cs" />
    6.13      <Compile Include="Win32API.cs" />