Update demo's with images in them

This commit is contained in:
inmarket 2014-02-07 14:08:39 +10:00
parent bd48279227
commit 010e0f0d62
6 changed files with 15 additions and 8 deletions

View File

@ -51,5 +51,8 @@
#define GDISP_NEED_IMAGE_JPG FALSE
#define GDISP_NEED_IMAGE_PNG FALSE
#define GFX_USE_GFILE TRUE
#define GFILE_NEED_MEMFS TRUE
#endif /* _GFXCONF_H */

View File

@ -53,12 +53,11 @@ int main(void) {
// Set up IO for our image
#if USE_MEMORY_FILE
gdispImageSetMemoryReader(&myImage, test_pal8);
gdispImageOpenMemory(&myImage, test_pal8);
#else
gdispImageSetSimulFileReader(&myImage, "test-pal8.bmp");
gdispImageOpenFile(&myImage, "test-pal8.bmp");
#endif
gdispImageOpen(&myImage);
gdispImageDraw(&myImage, 0, 0, swidth, sheight, 0, 0);
gdispImageClose(&myImage);

View File

@ -51,5 +51,8 @@
#define GDISP_NEED_IMAGE_JPG FALSE
#define GDISP_NEED_IMAGE_PNG FALSE
#define GFX_USE_GFILE TRUE
#define GFILE_NEED_MEMFS TRUE
#endif /* _GFXCONF_H */

View File

@ -76,12 +76,11 @@ int main(void) {
// Set up IO for our image
#if USE_MEMORY_FILE
gdispImageSetMemoryReader(&myImage, testanim);
if (!(gdispImageOpenMemory(&myImage, testanim) & GDISP_IMAGE_ERR_UNRECOVERABLE)) {
#else
gdispImageSetFileReader(&myImage, "testanim.gif");
if (!(gdispImageOpenFile(&myImage, "testanim.gif") & GDISP_IMAGE_ERR_UNRECOVERABLE)) {
#endif
if (gdispImageOpen(&myImage) == GDISP_IMAGE_ERR_OK) {
gdispImageSetBgColor(&myImage, MY_BG_COLOR);
// Adjust the error indicator area if necessary
if (myImage.width > errx && myImage.height < sheight) {

View File

@ -79,6 +79,10 @@
#define GWIN_NEED_RADIO TRUE
#define GWIN_NEED_LIST TRUE
/* Features for the GFILE subsystem. */
#define GFX_USE_GFILE TRUE
#define GFILE_NEED_MEMFS TRUE
/* Features for the GINPUT subsystem. */
#define GINPUT_NEED_MOUSE TRUE

View File

@ -184,8 +184,7 @@ static void createWidgets(void) {
wi.g.x = 0+2*(LIST_WIDTH+1); wi.text = "L3"; ghList3 = gwinListCreate(0, &wi, TRUE);
gwinListAddItem(ghList3, "Item 0", FALSE); gwinListAddItem(ghList3, "Item 1", FALSE);
gwinListAddItem(ghList3, "Item 2", FALSE); gwinListAddItem(ghList3, "Item 3", FALSE);
gdispImageSetMemoryReader(&imgYesNo, image_yesno);
gdispImageOpen(&imgYesNo);
gdispImageOpenMemory(&imgYesNo, image_yesno);
gwinListItemSetImage(ghList3, 1, &imgYesNo);
gwinListItemSetImage(ghList3, 3, &imgYesNo);