From 010e0f0d626b0f03cec9e8dd876762acb38fafc3 Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 7 Feb 2014 14:08:39 +1000 Subject: Update demo's with images in them --- demos/modules/gwin/widgets/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'demos/modules/gwin/widgets/main.c') diff --git a/demos/modules/gwin/widgets/main.c b/demos/modules/gwin/widgets/main.c index af2926d7..80c39dd9 100644 --- a/demos/modules/gwin/widgets/main.c +++ b/demos/modules/gwin/widgets/main.c @@ -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); -- cgit v1.2.3 From 4d3a08f5cfd244f82d1283cab702450e1dad14cd Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 7 Feb 2014 18:44:32 +1000 Subject: Update image demo's to use GFILE ROMFS. --- demos/modules/gwin/widgets/main.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'demos/modules/gwin/widgets/main.c') diff --git a/demos/modules/gwin/widgets/main.c b/demos/modules/gwin/widgets/main.c index 80c39dd9..7c06f3bf 100644 --- a/demos/modules/gwin/widgets/main.c +++ b/demos/modules/gwin/widgets/main.c @@ -28,16 +28,19 @@ #include "gfx.h" -// include our chibios logo in a .gif format -#include "image_chibios.h" -#include "image_yesno.h" - /** * This demo demonstrates many of the GWIN widgets. * On the "Radio" tab try playing with the color radio buttons. * On the "Checkbox" tab try playing with the "Disable All" checkbox. */ +/** + * The image files must be stored on a GFILE file-system. + * Use either GFILE_NEED_NATIVEFS or GFILE_NEED_ROMFS (or both). + * + * The ROMFS uses the file "romfs_files.h" to describe the set of files in the ROMFS. + */ + /* Our custom yellow style */ static const GWidgetStyle YellowWidgetStyle = { Yellow, // window background @@ -184,14 +187,14 @@ 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); - gdispImageOpenMemory(&imgYesNo, image_yesno); + gdispImageOpenFile(&imgYesNo, "image_yesno.gif"); gwinListItemSetImage(ghList3, 1, &imgYesNo); gwinListItemSetImage(ghList3, 3, &imgYesNo); // Image wi.g.x = ScrWidth-210; wi.g.y = TAB_HEIGHT + 10; wi.g.width = 200; wi.g.height = 200; ghImage1 = gwinImageCreate(0, &wi.g); - gwinImageOpenMemory(ghImage1, image_chibios); + gwinImageOpenFile(ghImage1, "chibios.bmp"); gwinImageCache(ghImage1); // Console - we apply some special colors before making it visible -- cgit v1.2.3