Announcement

Collapse
No announcement yet.

Displaying Image with file_Image()

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

  • Displaying Image with file_Image()

    I'm trying to display an image on a 7" diablo16 display.

    Using Visi and the gci/dat files, I can display my image using img_setword/show. But if I try to do the following:
    var hndl;
    hndl := file_Open("1.png", 'r');
    print(file_Error());

    file_Image(0, 0, hndl);

    Nothing displays. I get no errors, I have a valid handle. The image isn't clipping, as I have turned on clipping also, with the same result. It is a FAT16 formatted card with a 4gb partition.

    Thanks!

  • #2
    Hello Kyle,

    In 4DGL, images that are used in project are converted to its 16-bit state and are
    grouped and placed in GCI file to be easily interpreted by the display.

    It is not ideal for the display to decompress and then interpret the compressed image files (i.e., jpg, png)
    since it will take time, hence will cause delay.

    Therefore, the best way for the display to utilize images can only be done
    by directly accessing its simpler form data (.GCI).

    Best regards,

    - Vince -
    Vince_4D

    Comment


    • #3
      Originally posted by Vince_4D View Post
      Hello Kyle,

      In 4DGL, images that are used in project are converted to its 16-bit state and are
      grouped and placed in GCI file to be easily interpreted by the display.

      It is not ideal for the display to decompress and then interpret the compressed image files (i.e., jpg, png)
      since it will take time, hence will cause delay.

      Therefore, the best way for the display to utilize images can only be done
      by directly accessing its simpler form data (.GCI).

      Best regards,

      - Vince -
      OK thanks. But now if I don't want to use visi, and just want to write code, what's the best way to convert my images to Gci?

      Comment


      • #4
        Originally posted by kylehunter View Post

        OK thanks. But now if I don't want to use visi, and just want to write code, what's the best way to convert my images to Gci?
        Nevermind, I'll just use visi for that section.

        I have another question.

        I have a layout with a non solid background, which has a countdown timer over it. I can't use the string object, as the text is too big, it comes out really pixelated and overall looking bad. Is there a way for me to overlay an image for each digit, and just move them accordingly? I've tried with a transparent png, but it just displays a color background anyway.

        I can't have the timer on the same image as all of my background, because it has to countdown from 15 minutes, which is far too many images for each time. I need to be able to place an image of the digits 0 through 9, with a transparent background on top of my image.

        Thanks

        Click image for larger version

Name:	download.png
Views:	2
Size:	82.9 KB
ID:	63106
        Attached Files
        Last edited by kylehunter; 26th April 2018, 11:54 PM.

        Comment


        • #5
          Hi again Kyle,

          To start with, displaying images with transparent components will copy the image of the form.

          Since you displayed the image with blackbackground, I think you used the default property of the form with BGtype- Color and Color - BLACK.

          To address this, set your layout background as the image of the form instead of placing it in an image widget. Follow these steps to do so:
          1. Select the Form object
          2. Change BGtype Colorto Image
          3. Place your layout (background) image in the Image Tab

          Hope this will help.

          Best regards,

          - Vince -
          Vince_4D

          Comment


          • #6
            Originally posted by Vince_4D View Post
            Hi again Kyle,

            To start with, displaying images with transparent components will copy the image of the form.

            Since you displayed the image with blackbackground, I think you used the default property of the form with BGtype- Color and Color - BLACK.

            To address this, set your layout background as the image of the form instead of placing it in an image widget. Follow these steps to do so:
            1. Select the Form object
            2. Change BGtype Colorto Image
            3. Place your layout (background) image in the Image Tab

            Hope this will help.

            Best regards,

            - Vince -
            Perfect. Thank you so much

            Comment


            • #7
              No worries Kyle.

              If you found a problem in your project, just notify us and we will try to help you in the best way we could.

              Have fun coding!

              Vince
              Vince_4D

              Comment


              • #8
                Originally posted by Vince_4D View Post
                No worries Kyle.

                If you found a problem in your project, just notify us and we will try to help you in the best way we could.

                Have fun coding!

                Vince
                Hi Vince,

                I think I've found a bit of a nasty bug with the Diablo16 displays. I have tested with 24D and 70DCT

                My project is controlling an H-bridge module directly from the LCD. I have a 1k current limiting resistor and a 10k pull down on each input for the bridge. I have two of these modules on my PCB, using 4 pins for control: CNTRL_INa1/INb1/INa2/INb2 corresponding to pins 13, 14, 15, and 16 respectively.

                H-bridge 2, using pins 13 and 14, works perfectly, with its default state LOW for both CNTRL pins.
                H-bridge 1, does not work. Pin 15, CNTRL_INb1 has an issue internally.

                When the LCD screen is powered on, it drives the pin 15 high, even over my pull-down resistor.
                If I set it to an output using "pin_LO(pin_b1_cntrl);" and try to drive it low, it stays high.
                If I set it to an input, it will go low.
                If I force it to be an output with "pin_Set(PIN_OUT, pin_b1_cntrl)" It will go low, and I can control it both high and low.

                So it looks like for only this specific pin, it's default state of an open drain is leaking voltage? That and doing pin_LO doesn't set it as an output but as an open drain.

                It only shows this behavior for this specific pin, so it may be a hardware issue either on the board for the LCD, or the IC itself.

                I assume it can be recreated just using a pulldown and a current limiting resistor, I'll try to do that tomorrow, but I'm done for today, spent too much time already figuring this out!

                Thanks

                ​​​​​​​ ​​​​​​​ ​​​​​​​ Click image for larger version

Name:	Screenshot_4.png
Views:	2
Size:	1.8 KB
ID:	63173
                Click image for larger version

Name:	Screenshot_5.png
Views:	1
Size:	5.6 KB
ID:	63174
                Attached Files

                Comment


                • #9
                  Greetings Kyle,

                  First off, may I know what do you mean by pin 13 to 16? Is it Diablo PA13 to PA16 pin or GEN4-PA GPIO13 to GPIO16 pin? GEN4-PA pin corresponds to Diablo pin. (refer to gen4-PA datasheet, https://www.4dsystems.com.au/product...heet_R_1_1.pdf )

                  Based on my understanding, the two input pins are working and the other two are not in a gen4-uLCD-70DCT display.

                  Here is the probable explanation why the pins are not working the way they should be.

                  Resistive and Capacitive Touch LCDs (DT/DCT-CLB models) allocated two input pins, pins PA12 and PA13, in order for the displays to interpret touch, thus it is not advisable to use these pins as an input.

                  You can try other pins as an input since all other pins can be configured to be so.
                  (check for Pin Config I/O Support Functions in gen4-uLCD-70D datasheet, https://www.4dsystems.com.au/product...heet_R_1_6.pdf)

                  Hope this will help.

                  Best regards,

                  Vince
                  Vince_4D

                  Comment


                  • #10
                    Originally posted by Vince_4D View Post
                    Greetings Kyle,

                    First off, may I know what do you mean by pin 13 to 16? Is it Diablo PA13 to PA16 pin or GEN4-PA GPIO13 to GPIO16 pin? GEN4-PA pin corresponds to Diablo pin. (refer to gen4-PA datasheet, https://www.4dsystems.com.au/product...heet_R_1_1.pdf )

                    Based on my understanding, the two input pins are working and the other two are not in a gen4-uLCD-70DCT display.

                    Here is the probable explanation why the pins are not working the way they should be.

                    Resistive and Capacitive Touch LCDs (DT/DCT-CLB models) allocated two input pins, pins PA12 and PA13, in order for the displays to interpret touch, thus it is not advisable to use these pins as an input.

                    You can try other pins as an input since all other pins can be configured to be so.
                    (check for Pin Config I/O Support Functions in gen4-uLCD-70D datasheet, https://www.4dsystems.com.au/product...heet_R_1_6.pdf)

                    Hope this will help.

                    Best regards,

                    Vince
                    I'm referring to physical pins, as seen in the screenshot of my schematic.

                    Wow, that really should be documented better, and should have an asterisks or something on the chart that shows pins functionality.. That's really misleading how it is now. Showing multiple tables and charts showing its usability and pin mapping. The one paragraph after that saying if you have a touch screen and want to use it, then ignore all of our charts for these pins..

                    I already have the pcb manufacturered. Will the touch be completely broken if I use those pins?
                    Last edited by kylehunter; 1st May 2018, 08:18 PM.

                    Comment


                    • #11
                      Hello Kyle

                      I'm referring to physical pins, as seen in the screenshot of my schematic.
                      Sorry your screenshot does not mean a lot, as they are highly cropped and do not show what these pins are even relating to, display, some other component on your board, etc.
                      Your schematic is incomplete from the perspective of an outsider trying to understand what it relates to.

                      My guess is you are referring to the gen4-uLCD-70DCT-CLB's 30 way FPC pins?
                      Click image for larger version  Name:	2018-05-01_23-43-07.png Views:	1 Size:	136.5 KB ID:	63180

                      If so, then these are referred to as PA11, PA12, PA13 and PA14 from the point of view of the processor.

                      In section 4.2 of the Datasheet it gives specific information of PA12 and PA13 - and I am sorry if you have somehow missed this before designing your board, but the information stands.
                      They are used for I2C connections to the capacitive touch controller, so yes, if you try and use these for GPIO then your touch either wont work, or you may have problems attempting to control them as GPIO, as they will be controlled from the PmmC of the display as its a CTP version.

                      The datasheet covers all touch variants for this model, and pins can be used for multiple things, and in this case they are used by the module itself on the CTP version. Your point has been noted that an * or something indicating other functionality could be put on the table to allow Users to dig deeper, however the information is all present in the datasheet. This will be passed onto the document team, to see if improvements can be made to make this clearer. I am not sure if I have encountered someone trying to use these pins on a CTP model before however, but I am sorry that this is going to cause you grief.

                      In terms of your designed board, I dont know what to tell you other than what is written above, it just wont work as a GPIO when using Capacitive Touch, as those pins are used for the I2C for the Capacitive Touch controller. You need to move those 2 signals to some other available GPIO.

                      Regards
                      James

                      Comment


                      • #12
                        Originally posted by James_4DSystems View Post
                        Hello Kyle


                        Sorry your screenshot does not mean a lot, as they are highly cropped and do not show what these pins are even relating to, display, some other component on your board, etc.
                        Your schematic is incomplete from the perspective of an outsider trying to understand what it relates to.

                        My guess is you are referring to the gen4-uLCD-70DCT-CLB's 30 way FPC pins?
                        Click image for larger version Name:	2018-05-01_23-43-07.png Views:	1 Size:	136.5 KB ID:	63180

                        If so, then these are referred to as PA11, PA12, PA13 and PA14 from the point of view of the processor.

                        In section 4.2 of the Datasheet it gives specific information of PA12 and PA13 - and I am sorry if you have somehow missed this before designing your board, but the information stands.
                        They are used for I2C connections to the capacitive touch controller, so yes, if you try and use these for GPIO then your touch either wont work, or you may have problems attempting to control them as GPIO, as they will be controlled from the PmmC of the display as its a CTP version.

                        The datasheet covers all touch variants for this model, and pins can be used for multiple things, and in this case they are used by the module itself on the CTP version. Your point has been noted that an * or something indicating other functionality could be put on the table to allow Users to dig deeper, however the information is all present in the datasheet. This will be passed onto the document team, to see if improvements can be made to make this clearer. I am not sure if I have encountered someone trying to use these pins on a CTP model before however, but I am sorry that this is going to cause you grief.

                        In terms of your designed board, I dont know what to tell you other than what is written above, it just wont work as a GPIO when using Capacitive Touch, as those pins are used for the I2C for the Capacitive Touch controller. You need to move those 2 signals to some other available GPIO.

                        Regards
                        Yeah, it's those pins, sorry for the confusion.

                        Absolutely, I agree that you do clearly state it in the following paragraphs, but when you go and look over a datasheet and see the chart that you just posted, you (rightfully?) assume that you can use PA12/13 as a GPIO, since it is stated. You don't think to keep reading to find a section stating that they actually can't be used for that.

                        Two other points:

                        1) Datasheet for 24D_ doesn't state that for resistive touch you can't use those pins.
                        2) I think you should doublecheck the status of pin PA13. Even when using a 24D, non-touch display, it is held high, as if there is a pull-up. That is why, yesterday I didn't think it was a touch issue, because I tested it with a non-touch.
                        Last edited by kylehunter; 1st May 2018, 11:09 PM.

                        Comment


                        • #13
                          I think you need to check your setup, firmware revisions, code, hardware, etc.

                          On a Gen4-uLCD-24D, Driver 16/03/08, PmmC v2.0 PA13 is definitely floating with a simple 'hello world' program

                          On a Gen4-uLCD-70DCT-CLB, Driver 16/06/09, PmmC V2.0 PA13 is pulled to 3.3v by the on board 4k7 pullup
                          Mark

                          Comment

                          Working...
                          X