Digole
Digital Solutions
iDigole Buyer ProtectioniDigole Buyer
Protection
My shopping cart
0 Items:
Secure Checkout
Top Rated Plus
Visit Our Live Auctions
99.9% Customer's Satisfaction
 
Forum : Digole Serial Display :

 Search Forum.. 
 Creat New Topic   Reply 

Thomas Baumann create a VB library for Digole serial module, here is the how to

Thanks for the code contribution from Thomas Baumann
Usage example:
 

Dim display As Digole

display = New Digole("COM12")

display.SetBaudrate(115200)

display.ClearScreen()

display.SetFont(10)

display.SetTrueColor(Drawing.Color.Gray)

display.SetTextPosAbs(4, 95)

display.Print("Out: 50,001 Hz, 50 %")

display.SetTextPosAbs(4, 105)

display.Print("Tolerance: 0.01 %")


display.Dispose()


 
Also I created routines which converts image files into the 256/64k/262k raw format the display needs.
 

Friend Sub ConvertImageTo256RAW(ByVal InImage As StringByVal OutImage As String)


Const Mask As Byte = &HE0


' RRRGGGBB


Using inBmp As New Drawing.Bitmap(InImage)

Using outBmp As New IO.FileStream(OutImage, IO.FileMode.Create, IO.FileAccess.Write)


For y As Integer = 0 To inBmp.Height - 1

For x As Integer = 0 To inBmp.Width - 1


Dim c As Drawing.Color = inBmp.GetPixel(x, y)


outBmp.WriteByte( _

  (c.R And Mask) Or _

  ((c.G And Mask) >> 3) Or _

  (c.B >> 6) _

)


Next

Next


outBmp.Close()


End Using

End Using


End Sub

Friend Sub ConvertImageTo64kRAW(ByVal InImage As StringByVal OutImage As String)


Const MaskRB As Byte = &HF8

Const MaskGh As Byte = &HE0

Const MaskGl As Byte = &H1C


' RRRRRGGG GGGBBBBB


Using inBmp As New Drawing.Bitmap(InImage)

Using outBmp As New IO.FileStream(OutImage, IO.FileMode.Create, IO.FileAccess.Write)


For y As Integer = 0 To inBmp.Height - 1

For x As Integer = 0 To inBmp.Width - 1


Dim c As Drawing.Color = inBmp.GetPixel(x, y)


outBmp.WriteByte( _

  (c.R And MaskRB) Or _

  ((c.G And MaskGh) >> 5) _

)

outBmp.WriteByte( _

  ((c.G And MaskGl) << 5) Or _

  ((c.B And MaskRB) >> 3) _

)


Next

Next


outBmp.Close()


End Using

End Using


End Sub

Friend Sub ConvertImageTo262kRAW(ByVal InImage As StringByVal OutImage As String)


' 00RRRRRR 00GGGGGG 00BBBBBB


Using inBmp As New Drawing.Bitmap(InImage)

Using outBmp As New IO.FileStream(OutImage, IO.FileMode.Create, IO.FileAccess.Write)


For y As Integer = 0 To inBmp.Height - 1

For x As Integer = 0 To inBmp.Width - 1


Dim c As Drawing.Color = inBmp.GetPixel(x, y)


outBmp.WriteByte(c.R >> 2)

outBmp.WriteByte(c.G >> 2)

outBmp.WriteByte(c.B >> 2)


Next

Next


outBmp.Close()


End Using

End Using


End Sub


 

RE:Thomas Baumann create a VB library for Digole serial module, here is the how to

 You missed the "Digole.vb" file I attached to the e-mail I sent to you ;)

The code above was only an example how to use it.

 

I have uploaded the source to pastebin.

 

RE:Thomas Baumann create a VB library for Digole serial module, here is the how to

 Thank you very much for your contribution Thomas!

Copyright Digole Digital Solutions, 2008-2017. All rights reserved.
Powered by Victor Sun