Hello everyone!
now,I use eGUI and want to change the background picture of the screen. A problem occur.
My hardware: MCU MK60VLQ512DN
color LCD ,160X128 ,16bit/pixel RGB 565
software: MQX4.1.1
eGUI 3.0
Following is portion code,
/* Compression ratio: 39% */
const Byte icon_fsl[] = {
/* Bitmap dimension (W x H) */
0x00, 0x18, 0x00, 0x18,
/* Color mode */
0x80, 0x05,
/* Data */
0xFF, 0xFF, 0x39, 0xF6, 0xF6, 0x00, 0xF7, 0xFF, 0xFF, 0x11, 0xFA, 0xF1, 0xEC, 0xEC, 0x01, 0xF7,
0xFF, 0xFF, 0x0F, 0xF6, 0xEC, 0xEC, 0x01, 0xF1, 0xFF, 0xFF, 0x00, 0xFE, 0xFE, 0x00, 0xFF, 0xFF,
0x0E, 0xF6, 0xF1, 0xFA, 0xFF, 0xFF, 0x00, 0xFE, 0xFE, 0x02, 0xFF, 0xFF, 0x10, 0xFE, 0xFE, 0x03,
0xFF, 0xFF, 0x00, 0xFA, 0xF6, 0xF7, 0xFF, 0xFF, 0x0D, 0xFE, 0xFE, 0x00, 0xFF, 0xFF, 0x00, 0xF7,
0xF1, 0xEC, 0xEC, 0x01, 0xFA, 0xFF, 0xFF, 0x0F, 0xF6, 0xEC, 0xEC, 0x01, 0xF1, 0xFA, 0xFF, 0xFF,
0x11, 0xF6, 0xF1, 0xF6, 0xFF, 0xFF, 0x0F, 0xFE, 0xFE, 0x01, 0xFF, 0xFF, 0x11, 0xFE, 0xFE, 0x03,
0xFF, 0xFF, 0x10, 0xFE, 0xFE, 0x02, 0xFF, 0xFF, 0x00, 0xF7, 0xF1, 0xF1, 0x00, 0xF6, 0xFF, 0xFF,
0x09, 0xFA, 0xF6, 0xFF, 0xFF, 0x01, 0xFE, 0xFF, 0xFF, 0x00, 0xF6, 0xEC, 0xEC, 0x01, 0xF1, 0xF7,
0xFF, 0xFF, 0x06, 0xF7, 0xF1, 0xEC, 0xEC, 0x00, 0xF1, 0xF7, 0xFF, 0xFF, 0x01, 0xF6, 0xEC, 0xEC,
0x00, 0xF1, 0xF6, 0xFF, 0xFF, 0x07, 0xF6, 0xEC, 0xEC, 0x01, 0xF1, 0xFA, 0xFF, 0xFF, 0x00, 0xFE,
0xFF, 0xFF, 0x01, 0xF6, 0xFF, 0xFF, 0x09, 0xF7, 0xF1, 0xF1, 0x00, 0xF6, 0xFF, 0xFF, 0x00, 0xFE,
0xFE, 0x02, 0xFF, 0xFF, 0x10, 0xFE, 0xFE, 0x04, 0xFF, 0xFF, 0x11, 0xFE, 0xFE, 0x01, 0xFF, 0xFF,
0x0E, 0xF7, 0xF1, 0xF1, 0x00, 0xF6, 0xFF, 0xFF, 0x11, 0xF6, 0xEC, 0xEC, 0x01, 0xF1, 0xF7, 0xFF,
0xFF, 0x0F, 0xF1, 0xEC, 0xEC, 0x00, 0xF1, 0xF6, 0xFF, 0xFF, 0x12, 0xFA, 0xF6, 0xFF, 0xFF, 0x29
};
what the color mode stand for ? this little log can normally display on the screen.
I use the freescale converter create one array for my background picture.
/* D4D array declaration */
const D4D_IMG_HEADER_2_D4DINT _5226220;
const Word _5226220_data[];
/* End of D4D array declaration - DO NOT MODIFY */
/* D4D bitmap definition */
D4D_DECLARE_BMP(bmp__5226220, &_5226220, NULL)
/* End of D4D bitmap definition - DO NOT MODIFY */
/* Format: name, bitmap dimension (W x H), color mode, pointer to data */
D4D_DECLARE_IMG_HEADER_2_D4DINT (_5226220, 160, 128, 0x8000, _5226220_data)
const Word _5226220_data[] = {
/* Data */
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0840, 0x1060, 0x1060, 0x1060, 0x0840, 0x0800,
0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0820, 0x0840, 0x0840, 0x0840, 0x0820, 0x0800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0840, 0x1080, 0x18C0, 0x20E1, 0x2102, 0x2102, 0x20E1, 0x18C1, 0x18A0, 0x18A0, 0x18A0,
0x18A0, 0x18C0, 0x18C1, 0x20C1, 0x28E1, 0x2902, 0x2902, 0x2902, 0x20E1, 0x20C1, 0x18A0, 0x1060, 0x0840, 0x0820, 0x0800, 0x0800,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0800, 0x0820, 0x0840, 0x0860, 0x0860, 0x0860, 0x0840, 0x0840, 0x0840, 0x0820,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0820, 0x0840, 0x0840, 0x0840, 0x0020, 0x0020, 0x0020, 0x0020,
0x0020, 0x0020, 0x0020, 0x0020, 0x0040, 0x0840, 0x0840, 0x0840, 0x0840, 0x0040, 0x0040, 0x0040, 0x0040, 0x0840, 0x0840, 0x0840,
0x0840, 0x0020, 0x0020, 0x0000, 0x0000, 0x0000, 0x0020, 0x0840, 0x0840, 0x0860, 0x1081, 0x18A1, 0x18A1, 0x18A1, 0x1081, 0x1060,
0x0860, 0x0840, 0x0840, 0x0860, 0x0860, 0x1060, 0x1081, 0x1081, 0x1081, 0x1060, 0x1060, 0x0860, 0x0840, 0x0840, 0x0820, 0x0020,
0x0020, 0x0020, 0x0020, 0x0820, 0x0840, 0x1080, 0x10A1, 0x20E1, 0x2122, 0x2942, 0x2942, 0x2122, 0x20E2, 0x18C1, 0x18C1, 0x18C1,
0x18C1, 0x20C1, 0x20E2, 0x20E2, 0x2902, 0x2922, 0x2922, 0x3142, 0x2922, 0x20E2, 0x20C1, 0x18A1, 0x1081, 0x1060, 0x1060, 0x0840,
0x0840, 0x0840, 0x0840, 0x0840, 0x0840, 0x0840, 0x0840, 0x0840, 0x0840, 0x0860, 0x0860, 0x0860, 0x0840, 0x0840, 0x0840, 0x0840,
0x0840, 0x0020, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0020, 0x0840, 0x0840, 0x0840, 0x0820, 0x0820, 0x0820, 0x0840,
0x0840, 0x0840, 0x0840, 0x0840, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0020, 0x0020, 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0040, 0x0040, 0x0840, 0x0020, 0x0020, 0x0020, 0x0020,
0x0020, 0x0020, 0x0020, 0x0040, 0x0840, 0x0040, 0x0040, 0x0040, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0040,
0x0020, 0x0020, 0x0020, 0x0000, 0x0000, 0x0020, 0x0020, 0x0840, 0x0840, 0x1060, 0x1081, 0x18A1, 0x18A1, 0x18A1, 0x18A1, 0x1081,
then I use the bmp as my background picture.
D4D_DECLARE_STD_PICTURE(background,0,0, 160, 128, &bmp__5226220)
// Standard screen declaration
D4D_DECLARE_STD_SCREEN_BEGIN(screen_entry, ScreenEntry_)
D4D_DECLARE_SCREEN_OBJECT(background)
D4D_DECLARE_SCREEN_END()
but it doesn't work.
Can anyone give me some addvice to solve this?
Thanks!
Best Regards
JW
Solved! Go to Solution.
Hello Jianwu Tong,
For the first question, the color mode code (in this case 0x8005 in the first example -lines 9 and 10-, 0x8000 in the second example, line 13) stands for the color mode used for the image conversion, in the Freescale Embedded GUI Converter Utility 3.0 this code are altered by the options "Conversion mode" and "Color mode":
For the second question, the way you are trying to show the picture is correct, I just ran your code and everything is showing fine in the screen (I used another image because your array is not complete in this post). When you try to show the image what do you see in the screen? Is the program flow correct?
EDIT: I attached the source code I used to show the next image as background.
The only thing that has to be done to show this screen is to call this line code wherever you want.
D4D_ActivateScreen(&screen_entry, D4D_TRUE);
And declare the screen in the same file where the screen is activated.
D4D_EXTERN_SCREEN(screen_test);
Regards,
Earl.
/* If this post answers your question please click the Correct Answer button */
Hello Jianwu Tong,
For the first question, the color mode code (in this case 0x8005 in the first example -lines 9 and 10-, 0x8000 in the second example, line 13) stands for the color mode used for the image conversion, in the Freescale Embedded GUI Converter Utility 3.0 this code are altered by the options "Conversion mode" and "Color mode":
For the second question, the way you are trying to show the picture is correct, I just ran your code and everything is showing fine in the screen (I used another image because your array is not complete in this post). When you try to show the image what do you see in the screen? Is the program flow correct?
EDIT: I attached the source code I used to show the next image as background.
The only thing that has to be done to show this screen is to call this line code wherever you want.
D4D_ActivateScreen(&screen_entry, D4D_TRUE);
And declare the screen in the same file where the screen is activated.
D4D_EXTERN_SCREEN(screen_test);
Regards,
Earl.
/* If this post answers your question please click the Correct Answer button */
hello, Earl.
Thanks for your reply.
Now,I understand what the color mode stands for.
When showing the picture on the screen,I just see one rectangle with connected diagonal.
For the background picture,a couple of days ago,I finally found that the 65K color mode macro definition was disabled, as following code;
// 65k colors bitmap without pallete
#define D4D_BMP_65536NOPAL_ENABLE D4D_FALSE
Then I enabled it,as following code,
// 65k colors bitmap without pallete
#define D4D_BMP_65536NOPAL_ENABLE D4D_TRUE
now, it's work normally.
Thanks!
Have a great day!
Best Regards,
JW