钻石会员
  
主题
帖子
积分13096
阅读权限50
注册时间2013-3-19
最后登录1970-1-1
在线时间 小时
|

楼主 |
发表于 2019-4-8 22:47
|
显示全部楼层
- #define HZ_MODE00 0//竖置横排
- #define HZ_MODE01 1//竖置竖排
- #define HZ_MODE10 2//横置横排
- #define HZ_MODE11 3//横置竖排
- /***********************************************************************************************
- * 函数说明: void lcdram_map( u8 *getdate,u8 *putdata,u8 high,u8 width,u8 style )
- * getdate 所得到的目标数据
- * putdata 原始的数据
- * high 汉字高度
- * width 汉字宽度
- * style 汉字风格(汉字排列模式)
- ***********************************************************************************************/
- void lcdram_map( u8 *getdate,u8 *putdata,u8 high,u8 width,u8 style )
- {
- WORD i,j,hbyte,wbyte;
- u8 i_8,j_8;
- wbyte = (width+7)/8;
- hbyte = (high+7)/8;
-
- if( style == HZ_MODE00 ) //????
- {
- for( i = 0; i < high; i++ )
- for( j = 0; j < width; j++ )
- {
- i_8 = i/8;
- if((*(putdata+wbyte*i+j/8)&(0x80>>(j%8))) > 0)
- getdate[i_8*width+j] |= (0x01<<(i%8));
- else
- getdate[i_8*width+j] &= (~(0x01<<(i%8)));
- }
- }
- else if(style == HZ_MODE01) //????
- {
- for( i = 0; i < high; i++ )
- for( j = 0; j < width; j++ )
- {
- if((*(putdata+wbyte*i+j/8)&(0x80>>(j%8))) > 0)
- getdate[j*hbyte+i/8] |= (0x01<<(i%8));
- else
- getdate[j*hbyte+i/8] &= (~(0x01<<(i%8)));
- }
- }
- else if(style == HZ_MODE11)//????
- {
- for( i = 0; i < high; i++ )
- for( j = 0; j < width; j++ )
- {
- j_8 = j/8;
- if((*(putdata+wbyte*i+j/8)&(0x80>>(j%8))) > 0)
- getdate[j_8*high+i] |= (0x80>>(j%8));
- else
- getdate[j_8*high+i] &= (~(0x80>>(j%8)));
- }
- }
- }
复制代码
|
|