Announcement

Collapse
No announcement yet.

Getting Pictures to display

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

  • Getting Pictures to display

    I have a ĀµOLED-128-G1(GFX) and a CB-128-G1 and I want to use the joystick to produce pictures when pushed left or right or any direction. I have the graphics composer software and have to tried to use that in combination with the 4D workshop 3 to try and display pictures. I can get the joystick to play tunes and display up, down, left, and right. Here is the code I try to use:
    #platform "GOLDELOX-GFX2"

    /*
    GOLEDELOX_GFX2 Running on uOLED128-G1
    focus window test
    */

    #inherit "4DGL_16bitColours.fnc"
    // Image - "Desert.jpg" Size 128x128
    // Width = 128
    // Height = 128
    // Usage: desert_jpg(x, y);
    #constant desert_jpg $uSD_SetSector(0x0000, 0x0000); uSD_Image

    // Image - "Penguins.jpg" Size 128x128
    // Width = 128
    // Height = 128
    // Usage: penguins_jpg(x, y);
    #constant penguins_jpg $uSD_SetSector(0x0000, 0x0031); uSD_Image

    // Image - "Chrysanthemum.jpg" Size 128x128
    // Width = 128
    // Height = 128
    // Usage: chrysanthemum_jpg(x, y);
    #constant chrysanthemum_jpg $uSD_SetSector(0x0000, 0x0062); uSD_Image

    func main()
    while(!media_Init())
    gfx_Cls();
    pause(300);
    putstr("what/n");
    pause(300);
    wend
    media_SetSector(0x0000, 0x0000);
    endfunc

    Does anyone have a sample program or a step by step process of loading the MicroSD correctly with the files and images needed to get them to display on the OLED? Any samply problems or suggestions would be greatly appreciated.

  • #2


    Follow the directions in the GC users guide to create your images as '4dgl' 'uSD Raw', and save them to the card.

    Look at the offsets in the .gc file created by graphics composer and determine where it has placed your images.

    In your program, use media_SetSector to point to the images and then media_Image to display them. ( I suspect you may have based your source on gfx2_orangeDisplay2.4dg, and missed the media_VideoFrame call inside print_16bitNumber, very important)
    Mark

    Comment


    • #3


      Thanks
      Any chance you could link me to the latest GC users guide?

      Comment


      • #4


        http://www.4dsystems.com.au/downloads/Graphics_Composer/Ver2.XX/Graphics-Composer-User-Guide-rev2_1.pdf

        It is also now included in the Graphics Composer zip file
        Mark

        Comment


        • #5


          Here is the GFX2demo.gcs Graphics Composer project file. This is what the latest GOLDELOX-GFX2 sample programs refer to.

          Unzip it and open in the Graphics Composer, modify the settings as you need and load to the uSD card using uSD Raw option.
          -Bilal

          Comment

          Working...
          X