I'm trying to load bitmaps from an external location (usb device) with eGui (D4D) v3 beta on TWR-K70.
When I enable the external file support with
#define D4D_EXTSRC_FILE_ENABLE D4D_TRUE
I get errors when I try to compile the project which tell me that d4d_extsrcFile (which is defined in d4d_extsrc.h) is undeclared in d4d_bmp.c and d4d_font.c.
There is a
extern const D4DFILE_FUNCTIONS d4d_extsrcFile;
in d4d_extsrc.h.
Does someone have an idea what might be wrong?
Thanks!
Solved! Go to Solution.
Hello,
if you switch on external bitmap support, you also have to define the eGUI API to file system, like this example:
D4D_DECLARE_FILE_FUNCTIONS(My_FileOpen, My_FileClose, My_FileRead, My_FileWrite, My_FileFseek, My_FileFtell)
And the functions My_FileOpen... must exists in your project.
Check the examples what I put on : https://community.freescale.com/message/323071#323071
Petr
Hello,
if you switch on external bitmap support, you also have to define the eGUI API to file system, like this example:
D4D_DECLARE_FILE_FUNCTIONS(My_FileOpen, My_FileClose, My_FileRead, My_FileWrite, My_FileFseek, My_FileFtell)
And the functions My_FileOpen... must exists in your project.
Check the examples what I put on : https://community.freescale.com/message/323071#323071
Petr
Thank you Petr!
I added the file functions and it know compiles without errors.
Still I can't see the bitmap on my screen. I added a bmp file with 8bit color to my USB stick root directory and made sure that the LCD screen is loaded after the usb initialization. Reading from the stick in general works fine.
I declared the bitmap with
D4D_DECLARE_BMPFILE(bmp_as, "AS.BMP")
and put it in a picture object with
D4D_DECLARE_STD_PICTURE(ds_logo_as, 130, 100, &bmp_as)
and finally added it to the screen
D4D_DECLARE_SCREEN_OBJECT(ds_logo_as)
What is missing?
Thanks!
I recompiled the project once more and know it works!
Don't know what was wrong.
Thank you again Petr!