Announcement

Collapse
No announcement yet.

Display image from uSD card FAT

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

  • Display image from uSD card FAT

    Hi,

    I continue working with the screen and I want to display an image reading it form the uSD card.

    I have first managed to display it using the draw_image command, so the image format is correct.
    Now I have written all the image bytes (width, height, colour mode and data) to a file in the SD card. The file of the file and data seems to be correct and is the same as the one sent in draw_image.

    The image format is taken from:
    Graphics Composer and the Display Modules - 4D SYSTEMS FORUM

    The problem comes when I use the display_image. I get the image reduced in size and duplicated (one next to the other). Is there any format incompatibility. I can change the format in case this is the problem (59 06 00) but from the documentation it seems that it is by default new format.

    Actually the display command is returning 15:
    File: IMAGE pos(20,10) offset 0
    --> 40 6D 69 6D 61 67 65 00 00 14 00 0A 00 00 00 00

  • #2


    I think I might found the problem... I think is that the colour mode is 2 bytes and I was using 1.

    I still have to check it out, tomorrow will do so.

    edit: quick test.. still the same

    Comment


    • #3


      Zip up and post your created image here so we can take a look at it
      Mark

      Comment


      • #4


        It seems the error is cause because you don't support 0x08 (256bits) image colour format.

        I was just displaying a line stored in a file like:
        0x00 0x01 0x00 0x5E 0x08 0x00 0xFF ..... 0xFF (94 bytes set to 0xFF)

        When displaying the image I got as replay 15, but the image was displayed but middle size. I know that because the I displayed a line 94 pixels long next to it and this line was double the size.

        I have changed the image file to 65K colour (0x10)
        0x00 0x01 0x00 0x2F 0x08 0x00 0xFF ..... 0xFF (94 bytes set to 0xFF - real length 47)

        Now the image is displayed correctly and the command returns 06. I'm trying with a more complex image during the morning and get back.

        Some questions:
        - Why don't you support 256bis image colour format as in the Draw Image Icon command?
        - What is the real format of the colour bytes in the Draw Image Icon command? Is it the same as in Replace Background colour?
        R4R3R2R1R0G5G4G3G2G1G0B4B3B2B1B0
        And when it is only 1 byte colour?

        I ask so as I'm dynamically generating the image.
        See you
        Jorge

        Comment


        • #5


          Hmm, 8bit (256 color) mode support was dropped ages ago. (err the logic went along the lines of 'who would want it'?)

          Not sure why the manual still refers to it.
          Mark

          Comment


          • #6


            Ok.. Now that I know I will try to stick to 16bits colours. I was using 8 bits as in order to transmit a quite simple ( black and white) I reduce the number of data in half.

            Now it will take double

            Besides, I have noticed that even when displaying an image from a file in the SD the drawing is not inmediate and you can see the lines being displayed.

            Thanks a lot.

            See you

            Comment


            • #7


              Besides, I have noticed that even when displaying an image from a file in the SD the drawing is not inmediate and you can see the lines being displayed.
              You haven't said what display you are using, the only time you can really see the lines being displayed is on the uVGA II set to max res and drawing a full screen, AFAIK
              Mark

              Comment


              • #8


                I'm using a uLCD43PT, and it seems you see a bit while drawing the white image over the black.

                It has better refresh rate using SD image load than with serial port..

                See you

                Comment


                • #9


                  Hi,

                  I m also trying to use FatImage function to display an image previosly stored into uSD card.

                  I m using graphics composer to produce an image with 16-bit resolution.

                  I m calling the function it passes (meaning returns ACK=06) but i m not seeing anything on the screen.

                  This function does not have any option for 8-16 bit selection.

                  Do you have any idea?

                  Regards,
                  Serkan

                  Comment


                  • #10


                    With what little information you have given me I can only guess that you have the filename wrong. Have you used a long filename and not its 'short' equivalent?

                    Otherwise show the full command so I can guess a bit better.
                    Mark

                    Comment


                    • #11


                      I m calling the function exactly the same as what GC generates in text file.

                      FatImage("dnm.Gci",0,0,0x00000000);

                      Regards,
                      Serkan

                      Comment


                      • #12


                        I did not success none of the FAT command a part from InituSD. It returns with ACK, then i call FatImage it also returns ACK but i can not see the image on the screen. Last i m calling ScreenCopyFAT it returns with NACK.

                        I dont know where the problem is?

                        Regards,
                        Serkan

                        Comment


                        • #13


                          Depending upon when you inserted the uSD card you may need to init it.

                          Also is it FAT16 (or FAT) formatted?
                          Mark

                          Comment


                          • #14


                            Hi,

                            In my case, I always initiate the card (just one more command). Then I use the diplay image from card command. As said by Support the SD has to be FAT16 (I havent tried fat32). You can also use the raw format, but I guess it is more difficutl.

                            Be sure that the format of the image is the correct. If you have a Hex editor open the file and see that the headers and everything is ok (it should be as they are generated by the default program).

                            Comment


                            • #15


                              I tougth FAT protect may not let writing the uSD card. Therefore, i called display control function with mode 0x08 value 00 to unprotect fat. But this function returned with NACK.

                              Anyhow, lets clear FatImage issue first? Why i can not see image on the screen altough function returns with ACK?

                              What i m doing is:
                              1. Open Graphics Composer
                              2. Add a jpg image to project
                              3. Click the build button with bit depth 16 selected (Offset is 0x0, Size is 20.578-Scrren size is 320x240 due to lanspace usage)
                              4. Chose 4DGL,SGC-Picasso-GCI-FAT Selected Folder. (Folderesktop)
                              5. Put the dnm.Gci file into microSD card.
                              6. Plug it into u32LCD-SGC module.
                              7. Restart the board.
                              8. Call the FatImage.

                              Regards,
                              Serkan

                              Comment

                              Working...
                              X