Announcement

Collapse
No announcement yet.

GCI File Format

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

  • GCI File Format

    Hi All,

    May I know how can I open up GCI formatted images by using any program?

    I wanted to load the gci formatted image from my SD card after it is captured by screencapture function of PICASO GFX2.

    Is anyone knows what is the format of GCI file? By knowing the format of GCI file, we can convert it to Bitmap by visual basic.

    I tried to use GCI2BMP program from the website below but an error saying "Read beyond end of file" pops up quite sometimes.
    http://4d.websitetoolbox.com/post/GCI-File-confusion-5583629

    Pls give me some recommendation. Thank you.

  • #2
    The 6 or 8 byte header for an image stored in a GCI file is as follows

    bytes 0:1 (big endian word) width
    bytes 2:3 (big endian word) height
    byte 4 image mode (usually 0x10)
    byte 5 zero for image, or nn for frame delay (in milliseconds).

    if byte 5 is non zero, this also indicated that it is a multi frame image (movie)
    in which case, bytes 6:7 holds number of frames, 65535 max (big endian word)


    // demo program, extract header and show image
    func main()
    var ms, k, D, fp, n, width, height, pixels, frames;

    while((n:=media_Init())==0)
    gfx_Cls();
    pause(300);
    print("Please insert SD card ",k++);
    pause(300);
    wend

    gfx_Cls();
    D := file_Mount();


    fp := file_Open("gfx2demo.gci", 'r'); // open standard demo file


    //&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&& &&&&&&&&&
    // first, Show the image file header values
    //&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&& &&&&&&&&&
    file_Seek(fp, 0x0000, 0x3800); // point to keypad
    print("width = ",(width:=ByteSwap(file_GetW(fp))),"\n");
    print("height = ",(height:=ByteSwap(file_GetW(fp))),"\n");
    print("mode = 0x",[HEX2]file_GetC(fp),"\n");
    print("delay = ",file_GetC(fp),"\n");
    print("frames = ",(frames:=ByteSwap(file_GetW(fp))),"\n");
    print("pixels = ",(pixels := width*height));

    //&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&& &&&&&&&&&
    // Show the image
    //&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&& &&&&&&&&&
    file_Seek(fp, 0x0000, 0x3800); // point to keypad
    pokeW(SYSTEM_TIMER_LO, 0);
    k := file_Image(100, 160, fp); // display the keypad
    ms := peekW(SYSTEM_TIMER_LO); // trap the time
    gfx_MoveTo(2,160);
    print(ms," Msec\n");

    repeat forever
    endfunc



    Regards,
    Dave

    Comment


    • #3


      Hi,
      Thanks for showing the demo program. But what I really want to do is taking out the SD card and use a card reader to read the gci image in the card using any computer program.
      Or, can the 32PT actually save images to SD card in bitmap or jpeg ? That way I can directly read the image saved by using Paint program.Thank you

      Comment


      • #4


        ahh I see, no, as the displays dont read/utilize a standard bmp it seemed pointless
        to provide a facility to create an internal function to do so.

        It would not be difficult to make a 4DGL program to make a bmp file, but it would be rather slow, at a really rough guess 10 to 20 seconds for a full screen.

        I see your other post http://4d.websitetoolbox.com/post/GCI-File-confusion-5583629?highlight=gci2bmp
        and the problem you were having with GCI2BMP

        When ESPsupport gets back from annual leave (Monday) we should be able
        to get him to post the latest version which most likely has that bug fixed.
        Regards,
        Dave

        Comment


        • #5


          Thank you so much. Hopefully he can fix the bug.

          Ying

          Comment


          • #6


            I've updated the other post, hopefully that has solved your problem.
            Mark

            Comment


            • #7
              Hello All,
              I know it has been a while since this topic has been addressed..... but.... I have generated the following separate files:

              360 - 480x320 BMP files. (so you can figure what these images are......)

              What I would like to do is create a GCI file that contains these files so that I can access them using the

              img_SetWord(hndl, gage_, IMAGE_INDEX, frame) ;
              img_Show(hndl, gage_);

              commands.

              What is the format that the GCI file needs, so that I can write a program to convert my BMP files and store them into a GCI file format?

              I have looked at a couple of GCI files using the GCI2BMP file and my file editor and have seen the first 5 bytes header and etc....
              on my particular example I have looked at, shows the Image at 00000000 and the video portion starts at 0004B200. I can see that with my file editor. My images are 306x306 with 16-bit color, but I am not understanding my math as I scroll down through the file with my file editor.

              Can somebody point me to any information about the GCI graphic format?

              Hope this is making sense.

              Thanks,
              Keith

              Comment


              • #8
                The format is described here http://forum.4dsystems.com.au/forum/...isplay-modules (Q3)
                Mark

                Comment


                • #9
                  Thanks Mark,
                  Don't you ever have a weekend??

                  Comment


                  • #10
                    It's the weekend now isn't it?
                    Mark

                    Comment

                    Working...
                    X