Announcement

Collapse
No announcement yet.

LCD Simulator

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • LCD Simulator

    I got the idea from here.

    So I decided to write my own. Still isn't finished, but the hardest parts are complete, just the tedious parts remain. So far I can render text in stringvar up to 30 characters (I will work on that limitation later), but so far only the lower case letters a-m are supported. I should be finished with the text rendering by monday. So far only one font size(9px x 13px), and no built in animation, but you can code your own just by changing control.text property. I should also have the color pallet adjustable by then.

    The main reason I did this is that I need one for a front end I am working on for a friend, and I really couldn't see spending $30-80 on something like this.

    Is anyone interested in testing this out? It will probably be ready around wendsday or so.


    CarPuter
    ----------------------------
    Planning....[||||||||||]60%
    Parts.......[||||||||||]20%
    Construction[||||||||||]0%
    Software....[||||||||||]0%


  • #2
    I would definitly like to try it out. I have created a simple one a while ago but it just didn't work good enough. It was far to processor intensive.

    With kind regards,

    FG van Zeelst

    PS. It might be usefull to specify what programming language you are using .
    Check out My Custom Frontend

    Comment


    • #3
      I am having the same problem. It looks alright, but the text updates are not fast enough and if you get a string of text more than 20 characters it visably slows down a lot and CPU usage jumps way to high while it's running.

      I am using VB.net btw

      I think I need to learn DirectX. My first try was to use a series of images but that created way to much HD access, but it did run a lot faster and you lost the ability chage it's colors.

      Perhaps I can make a series of icons and embed them into the control but again, you would only get the color scheme that was there. ::


      CarPuter
      ----------------------------
      Planning....[||||||||||]60%
      Parts.......[||||||||||]20%
      Construction[||||||||||]0%
      Software....[||||||||||]0%

      Comment


      • #4
        Yeah indeed speed is always a problem. Just did a search of pscode and found a piece of code that could help you. I am not that good using vb more a c++ but check it out I think it could help you.

        With Kind Regards,

        FG van Zeelst
        Attached Files
        Check out My Custom Frontend

        Comment


        • #5
          Wow thanks much

          It helps a lot


          CarPuter
          ----------------------------
          Planning....[||||||||||]60%
          Parts.......[||||||||||]20%
          Construction[||||||||||]0%
          Software....[||||||||||]0%

          Comment


          • #6
            No problem, cant wait to see how it turns out.
            Check out My Custom Frontend

            Comment


            • #7
              What I have learned so far:

              The source you proved was in VB6(Maybe vb5, the comments are unclear on this) so I can't directly compile it as I no longer have vb6. However I know vb6 well enough to be able to follow the code.

              The author built a custom wrapper for the gdi.dll. This is now called GDI+ and is included with the DirectX SDK. Under .Net its accessed "normally" by creating a gaphics object (vb.net: Dim g as Graphics)

              I am already using that method but apperently not to its fullest potential. In VB.Net there are 3 basics types of graphics. 1) Is what is held in the PictureBox control 2) The Image control (Dim i as New Image) and 3) The Graphics control.

              The problem is the data they use are not easily trasferable between the types. The path I took was to use "Image" controls and then use "Graphics" to manipulate them (change pixel colors). This was a disaster. With an 11x16 picture you have 176 pixels, and thus upto 176 seperate instructions. With a possability of 30 (A string of 30 characters)such images you have a max of 5280 commands to preform every time you want the text to change. That doesn't include what windows is doing in the background.

              What they did in the source you provided to bypass just about everything and access the gdi.dll directly, giving them much more control on what happend and when. I don't know how well it worked, but it had to be faster.

              Rather than set it up as images, they manipulated the way a font (or even a picture) was drawn on to (from what I can tell) the form, or at last whatever they used for a container. I didn't spend to much time at the code for the form except to find out what subs/function to look at.

              While they could learn something about documenting code, all in all, its very a nice piece of work. Thanks again for sharing


              CarPuter
              ----------------------------
              Planning....[||||||||||]60%
              Parts.......[||||||||||]20%
              Construction[||||||||||]0%
              Software....[||||||||||]0%

              Comment


              • #8
                Hi,

                Thanks for explaining. Sorry I did not see it was a vb6 code. Have them both on my pc and was pretty tired when i wrote the message (had a rough day ).

                But still as far as I can see it was usefull to you. Try searching http://www.pscode.com/ maybe there is a better example. It was just a quick search .

                With kind regards,

                FG van Zeelst
                Check out My Custom Frontend

                Comment


                • #9
                  Thanks again


                  CarPuter
                  ----------------------------
                  Planning....[||||||||||]60%
                  Parts.......[||||||||||]20%
                  Construction[||||||||||]0%
                  Software....[||||||||||]0%

                  Comment


                  • #10
                    He Thelgord how is the project comming. Can't wait to see the result .

                    With kind regards,

                    FG van Zeelst
                    Check out My Custom Frontend

                    Comment


                    • #11
                      Sorry about the long delay in this thread, I'm in the army and have been very busy with that. However, I am back on track and have just a couple more bugs to work out before opening it up for testing. If everything goes right I should be posting my dll for testers to try later today.

                      [Begin Edit]
                      I decided it would be better to edit than double post

                      Ok, here is what I have, a user control that simulates an LCD screen. (links later in the post) I would like it if others could test it out and let me knwo what they think.

                      Known Issues:
                      Recoloring - Changing a color takes longer than expected. To see color changes you must clear the display. I left that up to the user so they can decide when they are done with the colors.

                      You can have an array of LCD Cells up to 255x255 (bounds are stored in byte values).

                      Properties:
                      Color1 - Cell BackGround Color
                      Color2 - Inactive "dots"
                      Color3 - Active "dots"
                      Color4 - Highlight color for active "dots"
                      Lines - Number of lines of cells
                      Chars - Number of columns
                      Note: Each "Cell" is 11px wide by 15px high. The control will auto resize based on Lines x Chars.

                      Functions:
                      In VB, function do not "have" to return a value so you can call them like a sub (ie. function(params)). Or you can get a value back:
                      Dim RetVal As Byte
                      RetVal = Function(Params)

                      RetVal will equal error codes (more on that later)

                      InsertText(CellX,CellY,User Text) - Iserts a string of text
                      SetCell(CellX,CellY,String Text, IsExtended As Boolean) - Set the text of a single cell
                      ClearLCD() - Clears all text
                      ClearLine(CellX) - Clears all text on a single line (To clear a signle cell, just SetCell(Blank Space))

                      Error Codes:
                      0 = Success, no error
                      1 = Invalid Line Number
                      2 = Invalid Column Number
                      3 = Invalid Character

                      Special Characters:
                      Special Characters are just that, special. To access special characters (this works with SetCell as well) use Chr(139) (‹) followed by the character for the special text. It should be notes that if you have a Chr(139) character and send text that does not corispond to a special character, it will be evaluated as a normal character. So to get a special character you will ne to send Chr(139) &
                      "A" = Copyright Logo
                      "B" = Rights Reserved Logo
                      "C" = BarGraph Level 1
                      "D" = BarGraph Level 2
                      "E" = BarGraph Level 3
                      "F" = BarGraph Level 4
                      "G" = BarGraph Level 5
                      "H" = BarGraph Level 6
                      "I" = BarGraph Level 7
                      "J" = Key Symbol
                      "K" = BlueTooth Symbol
                      "L" = Wifi Symbol (I am not real happy with the way this looks, I will probably end up remaking it)
                      "M" = Cell Service Symbol
                      "N" = GPS Symbol (Again, not happy with the way this one looks)

                      Files:
                      Screen Shot of the app used to test its functions:

                      The Dll:
                      http://www.mediafire.com/?3zdejzgojy7

                      Please let me know what you think.


                      CarPuter
                      ----------------------------
                      Planning....[||||||||||]60%
                      Parts.......[||||||||||]20%
                      Construction[||||||||||]0%
                      Software....[||||||||||]0%

                      Comment

                      Working...
                      X