|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2011-7-25 13:32:47
|
显示全部楼层
绘图函数 -
- void draw_image_4 (int x,int y,int width,int height,unsigned char *pimage)
- {
- int i,j,k,pixel;
- unsigned char p;
- int iwidth = width/4 + (width & 1 ? 1:0);
- for (i=0;i<height;++i,pimage+=iwidth){
- for (j=0;j<iwidth;++j){
- p = pimage[j];
- for (k=0;k<4;++k){
- pixel = p % 4;
- p /= 4;
- switch(pixel){
- default:
- case 0:break;
- case 1:Bdisp_SetPoint_VRAM(x+k+j*4,y+i,0);break;
- case 2:Bdisp_SetPoint_VRAM(x+k+j*4,y+i,1);break;
- }
- }
- }
- }
- }
复制代码 |
|