精易论坛

标题: 请把这个C语言的人民币冠字号函数翻译成易语言的子程序 [打印本页]

作者: xjyehonghai    时间: 2013-11-30 19:29
标题: 请把这个C语言的人民币冠字号函数翻译成易语言的子程序
人民币冠字号图像   一个位表示一个像素点(0 表示白,1 表示黑)
240字节的冠号图像:120*16/8=240 字节
例:240 字节冠号图像数据如何得到 120*16 点阵位图数据

//CNYGet12016BIT( gSNImage12016BIT,gSNImage12016 );
//输入 240字节的冠号图像数据[gSNImage12016BIT]
//输出 120*16 点阵的位图数据[gSNImage12016]  
void CNYGet12024BIT( unsigned char* ipSrc,unsigned char* ipDst )
{
  unsigned short x,y,m,n;
  unsigned char  *theSrcPtr,*theDstPtr,theTmp;
   
  theSrcPtr = ipSrc ;
  for ( x=0 ;x<120 ; x+=1)
  {
     y=0;
     theDstPtr = ipDst + y*120 + x  ;

     theTmp = *theSrcPtr++ ;
     for ( m=0 ;m<8 ;m++ , theDstPtr +=120  , theTmp<<=1 )
     {   
        *theDstPtr = 255;
        if ( theTmp & 0x80)  *theDstPtr = 0;
     }
     theTmp = *theSrcPtr++ ;
     for ( m=0 ;m<8 ;m++ , theDstPtr +=120  , theTmp<<=1 )
     {   
        *theDstPtr = 255;
        if ( theTmp & 0x80)  *theDstPtr = 0;
     }
  }
}
谢谢大家了!

作者: laneagle007    时间: 2013-11-30 20:07
没什么好翻译的。两个参数 是无符号字符指针类型的,&是引用, for语句 就是循环  if语句就是 如果  指针 ++ 就是指针自增1指向下一个变量地址 ,还有几个变量没看到定义语句不好说。三年没接触c语言了。
作者: xjyehonghai    时间: 2013-12-1 12:19
laneagle007 发表于 2013-11-30 20:07
没什么好翻译的。两个参数 是无符号字符指针类型的,&是引用, for语句 就是循环  if语句就是 如果  指针 + ...

谢谢,还是不会翻译!
作者: xjyehonghai    时间: 2013-12-2 14:52
请大神给转换成易语言吧!非常非常感谢。。。。




欢迎光临 精易论坛 (https://125.confly.eu.org/) Powered by Discuz! X3.4