I need to convert this in uwp (There's no "Bitmap" in uwp.)
instead of "ByVal bmp As Bitmap" i need to use an URI like (Uri("ms-appx:///Assets/[login to view URL]"))
Pls ask, 5+2? Just to assure you've read my specs.
Public Sub PrintImage(ByVal bmp As Bitmap)
If [login to view URL] Mod 24 <> 0 Then
Throw New ArgumentException(
"Die Bildhöhe muss ein Vielfaches von 24 sein.")
End If
If [login to view URL] > &H3FF Then
Throw New ArgumentException(
"Die Bildbreite darf nicht größer als 1023 sein.")
End If
Dim buf As Byte()
Dim zeilenAnfang As Byte() = New Byte() {&H1B, &H2A, 33,
CByte([login to view URL] And &HFF), CByte(([login to view URL] >> 8) And &HFF)}
Dim bildBuf As Byte() = New Byte([login to view URL] * 3 - 1) {}
For i As Integer = 0 To [login to view URL] \ 24 - 1
' Durch die einzelnen Zeilen gehen
buf = zeilenAnfang
[login to view URL](buf, 0, [login to view URL])
buf = bildBuf
[login to view URL](buf, 0, [login to view URL])
For x As Integer = 0 To [login to view URL] - 1
For y As Integer = 0 To 23
Dim byteIdx As Integer = y \ 8 + x * 3
Dim c As Color = [login to view URL](x, i * 24 + y)
Dim bit As Boolean = [login to view URL]() < 0.5F
If bit Then
buf(byteIdx) = buf(byteIdx) Or CByte(1 << (7 - (y Mod 8)))
End If
Next
Next
[login to view URL](buf, 0, [login to view URL])
If i <> [login to view URL] \ 24 - 1 Then
' ESC J n für Paper Feed (n (hier 0) müsste eigentlich 48 sein für eine
' Zeile, aber geht mit kleineren Werten auch)
' Nicht LF verwenden, weil bei LF der normale Zeilenabstand verwendet
' wird!
buf = New Byte() {&H1B, &H4A, 0}
Else
' Am Schluss normaler Zeilenabstand nach unten.
buf = New Byte() {&HA}
End If
[login to view URL](buf, 0, [login to view URL])
Next
End Sub
Hi! 5+2 is 7, and I can easily convert the above code into a UWP application, I need less than 24 hours to complete this. I am ready to start now :) I know Basic (knew it since early 2000s), so this is easy for me - lots of experience :)