找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3346|回復(fù): 3
打印 上一主題 下一主題
收起左側(cè)

求大神幫忙,這是一個漢字的顯示程序,怎么能顯示多個漢字?

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:56061 發(fā)表于 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表示自建漢字庫中的個數(shù),循環(huán)查詢內(nèi)碼
        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()函數(shù)?
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復(fù)

使用道具 舉報

沙發(fā)
ID:1 發(fā)表于 2013-10-18 13:13 | 只看該作者
什么屏幕?
回復(fù)

使用道具 舉報

板凳
ID:56061 發(fā)表于 2013-10-18 15:43 | 只看該作者

宇順lcd 220*176 ,單個漢字已經(jīng)可以顯示了,就是想寫一個能顯示多個漢字的函數(shù),好方便調(diào)用。
回復(fù)

使用道具 舉報

地板
ID:56061 發(fā)表于 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;
        }         
}
回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機教程網(wǎng)

快速回復(fù) 返回頂部 返回列表