No announcement yet.

Displaying an Image in 4DGL

  • Filter
  • Time
  • Show
Clear All
new posts

  • Displaying an Image in 4DGL

    I'm trying to display an image on a Picaso-GFX2 based display but it isn't working. I've imported a PNG image into Graphics Composer, built the DAT and GCI files for a FAT drive, and copied them to a FAT formatted uSD (I suppose I should mention that I've done no manipulation of the image in GC, perhaps I'm missing a step here?). But when I compile and load the code below displays the "Failed to build image control..." error message. The code is as follows:
    var *Ihndl;var D;

    if (!(D:=file_Mount())) while(!(D:=file_Mount())) putstr("Drive not mounted..."); wendendif

    Ihndl := file_LoadImageControl("myImage.dat", "myImage.gci",1);

    if (Ihndl) print("image control=",[HEX] Ihndl,"\n"); else putstr("Failed to build image control....\n"); repeat forever endif
    img_SetPosition(Ihndl, 0, 10,10); img_Enable(Ihndl, 0);img_Show(Ihndl, ALL);repeat forever

  • #2

    There seems to be nothing fundamentally wrong with your code.

    What you are seeing seems to indicate either myImage.dat or myImage.gci or both are not on the uSD card.

    Can you check again and maybe put them up here if you are sure they are right