找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2774|回复: 3
打印 上一主题 下一主题
收起左侧

求大神帮忙,这是一个汉字的显示程序,怎么能显示多个汉字?

[复制链接]
跳转到指定楼层
楼主
ID:56061 发表于 2013-10-18 10:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
/********************************************************************
* 名称 : PutGB1616()
* 功能 : 在x,y位置写16*16点阵的汉字
* 输入 : unsigned short x, unsigned short  y, unsigned char c[2], unsigned int fColor,unsigned int bColor
*             x列             y行               汉字字符                前景色            背景色
* 输出 : 无
***********************************************************************/
void LCD_PutGB1616(unsigned short x, unsigned short  y, unsigned char c[2], unsigned int fColor,unsigned int bColor)
{
    unsigned int i,j,k;
    LCD_SetArea(x,  x+16-1,y, y+16-1);
    for (k=0;k<110;k++)
    { //110表示自建汉字库中的个数,循环查询内码
        if ((codeGB_16[k].Index[0]==c[0])&&(codeGB_16[k].Index[1]==c[1]))
        {
            for(i=0;i<32;i++)
            {
                unsigned short m=codeGB_16[k].Msk[i];
                for(j=0;j<8;j++)
                {
                    if((m&0x80)==0x80)
                    {
                        LCD_Write_Data_U16(fColor);
                    }
                    else
                    {
                        LCD_Write_Data_U16(bColor);
                    }
                    m<<=1;
                }
            }
        }  
    }
}

以上是显示一个汉字的程序,可是我想显示多个汉字(如 LCD_PutGB1616_data(x,y,"多个汉字",fColor,bColor)),该怎么写这个LCD_PutGB1616_data()函数?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:1 发表于 2013-10-18 13:13 | 只看该作者
什么屏幕?
回复

使用道具 举报

板凳
ID:56061 发表于 2013-10-18 15:43 | 只看该作者

宇顺lcd 220*176 ,单个汉字已经可以显示了,就是想写一个能显示多个汉字的函数,好方便调用。
回复

使用道具 举报

地板
ID:56061 发表于 2013-10-22 15:09 | 只看该作者
自己已解决!!!!!
void LCD_PutGB1616_data(unsigned short x, unsigned short  y, unsigned char *hz, unsigned int fColor,unsigned int bColor)
{
        unsigned char c[2];
        unsigned char *p = hz;

        while(*p)
        {       
                memcpy(c,p,2);       
                LCD_PutGB1616(x,y,c,fColor,bColor);
                p = p+2;
                x = x+16;
        }         
}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表