1# kumocw
可以是使用Canvas的功能,注意增加CANVAS_STYLE_IMG属性,将背景图像放到g_pucImage数组里,下面的代码我是在Stellarisware的hello_widget例程里修改的,
g_pucImage[]数组是用pnmtoc转换成的图片数据,我试过了可以实现您说的功能,您可以试试。
//*****************************************************************************
//
// The canvas widget acting as the background to the display.
//
//*****************************************************************************
Canvas(g_sBackground, WIDGET_ROOT, 0, &g_sHeading,
&g_sLcd240x320x16_8bit, 0, 23, 320, (240 - 23),
CANVAS_STYLE_FILL | CANVAS_STYLE_IMG, ClrBlack, 0, 0, 0, 0, g_pucImage, 0);
//*****************************************************************************
//
// The button used to hide or display the "Hello World" message.
//
//*****************************************************************************
RectangularButton(g_sPushBtn, &g_sHeading, 0, 0,
&g_sLcd240x320x16_8bit, 60, 60, 200, 40,
(PB_STYLE_OUTLINE | PB_STYLE_TEXT_OPAQUE | PB_STYLE_TEXT |
PB_STYLE_FILL | PB_STYLE_RELEASE_NOTIFY),
ClrDarkBlue, ClrBlue, ClrWhite, ClrWhite,
&g_sFontCmss22b, "Show Welcome", 0, 0, 0, 0, OnButtonPress); |