Announcement

Collapse
No announcement yet.

Picture scale

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

  • Picture scale

    Hello,

    I'm using a µLCD-32032-P1T and GC 2.0.1.2.
    In GC the properties of my new project is X 240 Y 320

    When I add an little image (ex: 100x22), there is no problem.
    But when I try to add a image with the same dimensions of my LCD (240x320), the picture is illegible.

    Any idea ?
    (Sorry for my so bad English)

    Vincent.

  • #2


    Are you using the built in slideshow for the pictures or using 4DGL program?
    The slideshow usually works fine for me, but the 4DGL takes a bit of working out.

    Comment


    • #3


      Hi,
      yes I use 4DLG for the touchscreen functions.

      Comment


      • #4


        The way I work out the sector address on the uSD card is to check the .txt file that gets created by Graphics Composer. A sample from one of my projects:

        File "test.bmp"
        Location = 0x200000(2097152)
        Width = 160 Height = 128 Bits = 16
        64, 73, 0, 0, 160, 128, 16, 0, 16, 0

        I look at the last two numbers in the fourth line "16,0".
        These are the two bytes that when combined, give the lower word of the sector address on the card. To display this first image, my code has:

        uSD_SetSector(0x0000, 0x1000);

        My images are 160x128 and the next picture in the .txt file is at "16,81".
        This indicates that I have bmp files at every 81 sectors.
        I actually have a lot of pictures (180) to display a dial, so I've created an index "cnt" to find the correct bmp file:

        uSD_SetSector(0x0000, (cnt * 81) + 0x1000);

        Hope this helps!

        Comment


        • #5


          Thank you for your help kevingill.

          Here is my txt file :
          HTML Code:
          File "xxx.bmp"
          Location = 0x200000(2097152)
          Width = 100 Height = 22 Bits = 16
          64, 73, 0, 0, 0, 100, 0, 22, 16, 0, 16, 0
          File "xxx.gif"
          Location = 0x201200(2101760)
          Width = 22 Height = 100 Bits = 16
          64, 73, 0, 0, 0, 22, 0, 100, 16, 0, 16, 9
          File "xxx.bmp"
          Location = 0x202400(2106368)
          Width = 22 Height = 100 Bits = 16
          64, 73, 0, 0, 0, 22, 0, 100, 16, 0, 16, 18
          File "xxx.bmp"
          Location = 0x203600(2110976)
          Width = 240 Height = 320 Bits = 16
          64, 73, 0, 0, 0, 240, 1, 64, 16, 0, 16, 27
          File "xxx.jpg"
          Location = 0x229000(2265088)
          Width = 240 Height = 320 Bits = 16
          64, 73, 0, 0, 0, 240, 1, 64, 16, 0, 17, 72
          File "xxx.jpg"
          Location = 0x24EA00(2419200)
          Width = 180 Height = 240 Bits = 16
          64, 73, 0, 0, 0, 180, 0, 240, 16, 0, 18, 117
          
          Here is my code :
          if(uSD_Init() == 0) 
          print("PLEASE INSERT uSD CARD");
          while(1);
          endif
          
          uSD_SetSector(0x0000, 0x1000); 
          uSD_Image(0, 0);
          But the screen is flashing/hanging
          On the µSD I only put the cgi and dat file, is it ok ?

          Comment


          • #6


            Vincent,

            I just use the Graphics Composer to put the files onto the uSD card. I don't put the cgi and dat files on the card.
            I use settings of "Write Command Block -> No" and "Image Format -> Image & Pixel Data (V2)" and write to the uSD card in a USB adapter.

            Must admit that I haven't tried to display different sized images on my 160-G1. I will give it a go if you're still having trouble.

            How does the new P1T display look? The old PMD3 looked fantastic - much better OLED than the 160-G1.

            Comment


            • #7


              Vincent,

              If you're going to use the new FAT16 file system to store images on the uSD card (copying the .cgi and .dat files created by the GC to a FAT16 formatted card), you need to use the file_LoadImageControl, img_SetPosition and img_Show 4DGL commands to position and display images. See the "TestImageControl.4dg" sample program supplied with the new 2.0 Beta version of the 4DGL Workshop.

              Your code, as posted, is meant to access raw pixel data written by the GC to an unformatted uSD card as described above by Kevin.

              Keep in mind that the FAT16 file system is only supported by the PICASO based displays (-Px and -PMDx).

              Steve
              Any technology, sufficiently developed, is indistinguishable from magic. A.C. Clark(RIP)

              NEW! Lower prices on all 4D Systems products for 2009 and continuing into 2010!
              http://shop.littlepcbsolutions.com

              Comment


              • #8


                and where can i find GC 2.0 with the examples???
                or just the examples. i downloaded the new version and there is not much examples...

                Comment


                • #9


                  Hi,

                  Screen flashing = constant reboot of the module
                  Try that instead:

                  HTML Code:
                  // Don't forget to clear the garbage first
                  gfx_Cls();
                  if(uSD_Init() == 0)
                  print("PLEASE INSERT uSD CARD");
                  // Avoid putting while(1) here, otherwise: infinite loop
                  while(uSD_Init());
                  endif
                  uSD_SetSector(0x0000, 0x1000);
                  uSD_Image(0, 0);
                  // Don't let the program fall out
                  while(1);
                  Best regards,
                  Julien

                  Comment


                  • #10
                    The sample 4DGL program I mentioned ealier is part of the new 4DGL Workshop 2.0 Beta install. It's located in the "Projects\Picaso" folder under the root install folder for the new Workshop. The new Graphics Composer has only the updated User Manual, no examples.

                    Attached below if you're having trouble finding it.

                    BTW - Take a close look at the code Julien posted. Be aware that even if your posted code worked, it would "fall through" and end in a reset of the device (reset and run prog in flash memory). The "while(1);" puts the program into an endless loop at that point.

                    Steve
                    Any technology, sufficiently developed, is indistinguishable from magic. A.C. Clark(RIP)

                    NEW! Lower prices on all 4D Systems products for 2009 and continuing into 2010!
                    http://shop.littlepcbsolutions.com

                    Comment


                    • #11
                      Hi,

                      Originally posted by Julien
                      // Avoid putting while(1) here, otherwise: infinite loop
                      Originally posted by smcmanus
                      Be aware that even if your posted code worked, it would "fall through" and end in a reset of the device (reset and run prog in flash memory). The "while(1);" puts the program into an endless loop at that point.
                      I used one of your examples :
                      http://www.4dsystems.com.au/developers/docs.php?cat=16&id=79



                      [hr]
                      Originally posted by smcmanus
                      The sample 4DGL program I mentioned ealier is part of the new 4DGL Workshop 2.0 Beta install.
                      I tried "uSD_Image" because I did not succeed in showing a big picture correctly with "img_Show".
                      Here are my first attempts largely inspired by your example:
                      Code:
                      if (!file_Mount())print("File error \n", file_Error());endifj := file_LoadImageControl("IMG.DAT", "IMG.GCI", 0);if (j)//elseputstr("Failed to build image control....\n");repeat forever  // just hang if we didnt get the image listendifimg_SetPosition( j, 0, 0, 0); // Position de l'imageimg_Show(j, 0); // Afficher l'image
                      It works perfectly with pictures of small sizes (100x22), but Impossible to show a picture size of which is equal to that of the screen.(320x240)


                      Comment

                      Working...
                      X