打印

请教有关图像显示的问题

[复制链接]
1938|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
kumocw|  楼主 | 2011-8-31 09:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
沙发
永远的不知| | 2011-8-31 10:27 | 只看该作者
在M3上背景图片的功能我没用过,我看看有没有好的方法。

使用特权

评论回复
板凳
永远的不知| | 2011-8-31 17:16 | 只看该作者
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);

使用特权

评论回复
地板
永远的不知| | 2011-8-31 17:17 | 只看该作者
Canvas(sName, pParent, pNext, pChild, pDisplay, lX, lY, lWidth,   
               lHeight, ulStyle, ulFillColor, ulOutlineColor, ulTextColor,
               pFont, pcText, pucImage, pfnOnPaint)  
利用的就是pucImage这个参数。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

0

主题

6

帖子

1

粉丝