Example in VB.NET - OpenMacroBoard/StreamDeckSharp GitHub Wiki
This is the VB.NET version of the example called "Austria". It was automatically converted from C# to VB.NET using this tool: http://converter.telerik.com/
I made a manual correction (because the converter got it wrong) in the for loop and changed the division operator from / to \. The integer division is just used as a mathematical trick to calculate the row number more information about integer division here:
- https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/integer-division-operator
- https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/floating-point-division-operator
Imports StreamDeckSharp
Module Module1
Sub Main()
'Create some color we use later to draw the flag of austria
Dim red = StreamDeckKeyBitmap.FromRGBColor(237, 41, 57)
Dim white = StreamDeckKeyBitmap.FromRGBColor(255, 255, 255)
Dim rowColors = New StreamDeckKeyBitmap() {red, white, red}
'Open the Stream Deck device
Using deck = StreamDeck.FromHID()
deck.SetBrightness(100)
'Send the bitmap informaton to the device
For i As Integer = 0 To deck.NumberOfKeys - 1
'Note: \ is an integer division operator
deck.SetKeyBitmap(i, rowColors(i \ 5))
Next
End Using
End Sub
End Module