Skip to content

Commit

Permalink
fixed LEDs appear only half of the screen
Browse files Browse the repository at this point in the history
  • Loading branch information
qiangqiang101 committed Apr 18, 2024
1 parent c6aefaf commit 27792f3
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 112 deletions.
6 changes: 3 additions & 3 deletions Wallpaper/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("Turn your wallpaper into an OpenRGB device. You can now control the RGB lighting on your wallpaper and synchronize wallpaper with other OpenRGB compatible devices by OpenRGB.")>
<Assembly: AssemblyCompany("Zettabyte Technology")>
<Assembly: AssemblyProduct("OpenRGB Wallpaper")>
<Assembly: AssemblyCopyright("Copyright © 2023 Zettabyte Technology")>
<Assembly: AssemblyCopyright("Copyright © 2024 Zettabyte Technology")>
<Assembly: AssemblyTrademark("")>

<Assembly: ComVisible(False)>
Expand All @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("1.6.0.0")>
<Assembly: AssemblyFileVersion("1.6.0.0")>
<Assembly: AssemblyVersion("1.7.0.0")>
<Assembly: AssemblyFileVersion("1.7.0.0")>
2 changes: 0 additions & 2 deletions Wallpaper/UserSettingData.vb
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ Public Structure Screen
Public IPAddress As String
Public Port As Integer
Public Autoconnect As Boolean
Public Timeout As Integer
Public ProtocolVersion As UInteger

'Device
Public Name As String
Expand Down
5 changes: 1 addition & 4 deletions Wallpaper/frmMain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ Public Class frmMain
End Try

.Autoconnect = False
.Timeout = 1000
.ProtocolVersion = 2
.BackgroundColor = ColorTranslator.ToHtml(Color.Black)
.Renderer = Renderer.Skia
End With
Expand Down Expand Up @@ -394,8 +392,7 @@ Public Class frmMain
Dim ucScr As New ucScreen
With ucScr
.WScreen = New Screen() With {.Autoconnect = False, .IPAddress = "127.0.0.1", .Name = $"Wallpaper{UserSettings.Screens.Count + 1}", .Port = 6742,
.ProtocolVersion = 2, .Timeout = 1000, .Position = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Location,
.Size = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Size}
.Position = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Location, .Size = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Size}
.Dock = DockStyle.Fill
End With
newTab.Controls.Add(ucScr)
Expand Down
5 changes: 3 additions & 2 deletions Wallpaper/frmWallpaper.vb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Public Class frmWallpaper
Public Sub Connect(ws As Screen)
Try
If Not oRgbClient Is Nothing Then oRgbClient.Dispose()
oRgbClient = New OpenRGBClient(ws.IPAddress, ws.Port, $"{ws.Name} [Skia]", ws.Autoconnect, ws.Timeout, ws.ProtocolVersion)
oRgbClient = New OpenRGBClient(ws.IPAddress, ws.Port, $"{ws.Name} [Skia]", ws.Autoconnect, 1000, 2)
Catch ex As Exception
renderString = $"48 Connect Error: {ex.Message}"
Log(ex)
Expand Down Expand Up @@ -131,7 +131,8 @@ Public Class frmWallpaper
Dim Width As Integer = oMatrix.Width
Dim Height As Integer = oMatrix.Height

Dim rectangleSize As New SizeF(ClientRectangle.Width / (wallpaper.Leds.Count / Height), ClientRectangle.Height / Height)
'Dim rectangleSize As New SizeF(ClientRectangle.Width / (wallpaper.Leds.Count / Width), ClientRectangle.Height / Height)
Dim rectangleSize As New SizeF(ClientRectangle.Width / Width, ClientRectangle.Height / Height)

Dim matrix(Width - 1, Height - 1) As String
Dim count As Integer = 0
Expand Down
5 changes: 3 additions & 2 deletions Wallpaper/frmWallpaperGDI.vb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Public Class frmWallpaperGDI
Public Sub Connect(ws As Screen)
Try
If Not oRgbClient Is Nothing Then oRgbClient.Dispose()
oRgbClient = New OpenRGBClient(ws.IPAddress, ws.Port, $"{ws.Name} [GDI]", ws.Autoconnect, ws.Timeout, ws.ProtocolVersion)
oRgbClient = New OpenRGBClient(ws.IPAddress, ws.Port, $"{ws.Name} [GDI]", ws.Autoconnect, 1000, 2)
Catch ex As Exception
renderString = $"48 Connect Error: {ex.Message}"
Log(ex)
Expand Down Expand Up @@ -187,7 +187,8 @@ Public Class frmWallpaperGDI
Dim Width As Integer = oMatrix.Width
Dim Height As Integer = oMatrix.Height

Dim rectangleSize As New SizeF(ClientRectangle.Width / (wallpaper.Leds.Count / Height), ClientRectangle.Height / Height)
'Dim rectangleSize As New SizeF(ClientRectangle.Width / (wallpaper.Leds.Count / Width), ClientRectangle.Height / Height)
Dim rectangleSize As New SizeF(ClientRectangle.Width / Width, ClientRectangle.Height / Height)

Dim matrix(Width - 1, Height - 1) As String
Dim count As Integer = 0
Expand Down
5 changes: 3 additions & 2 deletions Wallpaper/frmWallpaperGL.vb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Public Class frmWallpaperGL
Public Sub Connect(ws As Screen)
Try
If Not oRgbClient Is Nothing Then oRgbClient.Dispose()
oRgbClient = New OpenRGBClient(ws.IPAddress, ws.Port, $"{ws.Name} [OpenGL]", ws.Autoconnect, ws.Timeout, ws.ProtocolVersion)
oRgbClient = New OpenRGBClient(ws.IPAddress, ws.Port, $"{ws.Name} [OpenGL]", ws.Autoconnect, 1000, 2)
Catch ex As Exception
renderString = $"48 Connect Error: {ex.Message}"
Log(ex)
Expand Down Expand Up @@ -131,7 +131,8 @@ Public Class frmWallpaperGL
Dim Width As Integer = oMatrix.Width
Dim Height As Integer = oMatrix.Height

Dim rectangleSize As New SizeF(ClientRectangle.Width / (wallpaper.Leds.Count / Height), ClientRectangle.Height / Height)
'Dim rectangleSize As New SizeF(ClientRectangle.Width / (wallpaper.Leds.Count / Width), ClientRectangle.Height / Height)
Dim rectangleSize As New SizeF(ClientRectangle.Width / Width, ClientRectangle.Height / Height)

Dim matrix(Width - 1, Height - 1) As String
Dim count As Integer = 0
Expand Down
140 changes: 48 additions & 92 deletions Wallpaper/ucScreen.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions Wallpaper/ucScreen.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ Public Class ucScreen
cmbDeviceZone.SelectedItem = If(WScreen.Zone = Nothing, "", WScreen.Zone)
txtIPAddress.Text = WScreen.IPAddress
txtPort.Text = WScreen.Port
txtTimeout.Text = WScreen.Timeout
txtProtocol.Text = WScreen.ProtocolVersion
cbAutoconnect.Checked = WScreen.Autoconnect

txtDisplayX.Text = WScreen.Position.X
Expand All @@ -58,8 +56,6 @@ Public Class ucScreen
.Port = CInt(txtPort.Text)
.Name = cmbDeviceName.SelectedItem
.Zone = cmbDeviceZone.SelectedItem
.Timeout = CInt(txtTimeout.Text)
.ProtocolVersion = CInt(txtProtocol.Text)
.Autoconnect = cbAutoconnect.Checked
.Position = New Point(CInt(txtDisplayX.Text), CInt(txtDisplayY.Text))
.Size = New Size(CInt(txtDisplayWidth.Text), CInt(txtDisplayHeight.Text))
Expand Down Expand Up @@ -89,7 +85,7 @@ Public Class ucScreen
End Sub

Private Sub txtTextChanged(sender As Object, e As EventArgs) Handles txtIPAddress.TextChanged, txtDisplayHeight.TextChanged, cmbRenderer.SelectedIndexChanged,
txtDisplayWidth.TextChanged, txtDisplayX.TextChanged, txtDisplayY.TextChanged, txtPort.TextChanged, txtProtocol.TextChanged, txtTimeout.TextChanged,
txtDisplayWidth.TextChanged, txtDisplayX.TextChanged, txtDisplayY.TextChanged, txtPort.TextChanged,
cbAutoconnect.CheckedChanged, pbImage.BackgroundImageChanged, cmbImageFit.SelectedIndexChanged, btnBackColor.BackColorChanged

lblNotify.Visible = True
Expand Down

0 comments on commit 27792f3

Please sign in to comment.