Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

How to import an image to Nios II as an array?

Hi,

Does anyone know how to convert any type of image into a c array which can be read by using the gimp bmp library in the Nios II IDE 9.0?

Yours,

Hany Assasa

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Something like the following will generate a data item initialised with the bytes from a file - which might do what you want:

     
    objcopy -I binary -O elf32-little -B nios2 
        --rename-section .data=.rodata,alloc,load,readonly,data,contents 
        image.bmp image.o
    
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for your reply dsl,

    But can you give me an example about how to use this statment?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    Could u be able to load the image?

    Can you please share the code?