Announcement

Collapse
No announcement yet.

IMPOSSIBLE TO DISPLAY A PICTURE

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

  • IMPOSSIBLE TO DISPLAY A PICTURE

    Hello,
    After reading your docs, I am always confused...This is my problem:
    I would like to display a picture named logo.jpg with my program developed with the uLCD32PT_GFX2 platform and device.
    I think I followed the good steps:
    1) I formated my uSD card from Windows with the FAT option. A success.
    2) I launch Graphics-Composer.
    3) I create a new file named "logo".
    4) I change properties: X=320, Y=240.
    5) I add an image named fond.jpg
    6) I save the file "logo".
    7) I go into "Load Options" and I choose 4DGL platform (Format= FAT16 Raw partition, Drive= I).
    8) I "Load Device": Graphics composer asks me to format again the uSD card (why? I already formated it.).
    9) I accept. Finally the load is "successful".
    10) I eject my uSD from my computer.
    11) Yet, I decide to control the uSD directory. I place the uSD card into my computer one more time. Here is its directory:"4dglgci 1ko DAT file"Question: where is my file "fond.jpg"?
    12) I eject one more time my uSD card from my computer and I place it into the display uLCD-32PT(SGC) reader.
    13) Here is the code I wrote to download and display my "fond.jpg" on the screen:

    file_Mount();

    hFile := file_Open("fond_jpg", 'r');

    file_Image(0,0, hFile);

    file_Close(hFile);
    file_Unmount();
    It does not work at all. No picture. I guess I made a mistake. Where? Thank you for your patience.
    Best regards
    Greg

  • #2
    hi,

    The resolution is x = 240 and y = 320, not 320x240
    The fond.jpg is include in the .DAT file
    In your soft, you must open the DAT file not the jpg file.

    Look at my posted example http://4d.websitetoolbox.com/post/show_single_post?pid=41950831&postcount=4, it 's working, examine the TEST_FOND.4dg. In the Zip file, to be more understanding i placed the gcs file, the original jpg and the TEST.DAT and TEST.GCI file.

    Code:
     #platform "uLCD-32032-P1_GFX2"#inherit "4DGL_16bitColours.fnc"#constant IMAGEDEFOND               0var D;      // diskvar *himage;  // handle for image controlfunc main()gfx_Cls();txt_Set(FONT_SIZE, FONT1);putstr("Initialisation Carte...\n");pause(100);if (!(D:=file_Mount()))while(!(D:=file_Mount()))putstr("Carte absente ou invalide...");pause(200);gfx_Cls();pause(200);wendendifprint("Carte initialisee.\n");pause(500);himage := file_LoadImageControl("TEST.DAT", "TEST.GCI",1);img_SetPosition(himage,0,0,0);img_Show(himage,0);repeatforeverendfunc
    I think you make mistake in your code.
    Thierry
    Regards,

    Thierry - Avignon - France

    Comment


    • #3
      Wow, I have been working for 2 days trying to show a pic on the LCD. I have followed all the steps, and nothing. I downloaded your sample, and it works.

      Even when using your TEST sample, and replacing the .DAT and .CGI generated by the Graphics Composer, and the code at LoadImageControl, it does not work for my pic.

      Any suggestions on the GC3 use?

      Thanks!

      *** Update ***
      It is working, I did not code for the media mounting...

      putstr("Mounting...\n");
      if (!(disk:=file_Mount()))
      while(!(disk :=file_Mount()))
      putstr("Drive not mounted...");
      pause(200);
      gfx_Cls();
      pause(200);
      wend
      endif

      It has to be sure the media is loaded before trying to display any graph.

      Comment


      • #4


        Al images and videos that you insert into GC3 get converted into a format that can be used by the display and stored in the .GCI file. The .DAT file is more like an index into the .GCI file
        Mark

        Comment

        Working...
        X