MS Button und IDB Logik

This commit is contained in:
2019-11-20 16:19:22 +01:00
parent 8b9b409769
commit 3508aa486c
15 changed files with 706 additions and 649 deletions

View File

@@ -0,0 +1,28 @@
Module ModuleHelper
Public Function ByteArrayToBitmap(bytearray() As Byte) As Bitmap
Return New Bitmap(New System.IO.MemoryStream(bytearray))
End Function
Public Function StringToByteArray(ByVal hex As String) As Byte()
Dim NumberChars As Integer = hex.Length
Dim bytes(NumberChars / 2) As Byte
For i As Integer = 0 To NumberChars - 1 Step 2
bytes(i / 2) = Convert.ToByte(hex.Substring(i, 2), 16)
Next
Return bytes
End Function
Public Function BitmapToByteArray(bitmap As Bitmap) As Byte()
Dim bytearray As Byte()
Using stream As New System.IO.MemoryStream
bitmap.Save(stream, bitmap.RawFormat)
bytearray = stream.ToArray()
End Using
Return bytearray
End Function
End Module