修改wince开机界面logo
硬件环境:6410 + 3.5寸的屏,
1.图片格式为160*120 真彩色 用bmp2c转换后的图片数组为unsigned short 类型。
首先将图片转换成数组,这里用的工具是bmp2c,将转换后的数组替换wince600->PLATFORM->SDK6410->src>bootloader->eboot ->InitialImage_rgb16_320x240.h中的数组InitialImage_rgb16_320x240[]。
在VS2005里的wince 6.0的工程文件目录下找到wince600->PLATFORM->SDK6410->src ->bootloader->eboot ->main.c下的void InitializeDisplay(void)函数。
将static void InitializeDisplay(void)中的
#if(SMDK6410_LCD_MODULE == LCD_MODULE_HUA350)
memcpy((void *)EBOOT_FRAMEBUFFER_UA_START, (void *)InitialImage_rgb16_320x240, 320*240*2);
#elif (LCD_BPP == 16)
{
int i;
unsigned short *pFB;
pFB = (unsigned short *)EBOOT_FRAMEBUFFER_UA_START;
for (i=0; i<LCD_WIDTH*LCD_HEIGHT; i++)
*pFB++ = 0x0000;//0x001F; // Blue
修改为:
#if(SMDK6410_LCD_MODULE ==LCD_MODULE_QIM350)
//memcpy((void *)EBOOT_FRAMEBUFFER_UA_START, (void *)InitialImage_rgb16_320x240, 320*240*2);
{
int i;
for(i = 0; i < LCD_WIDTH*LCD_HEIGHT/2; i++)
{
PWORD pWord = (PWORD)InitialImage_rgb16_320x240;
PWORD pFrmBuf = (PWORD)EBOOT_FRAMEBUFFER_UA_START;
pFrmBuf[2 * i - 1* (i % LCD_WIDTH)] = pWord[i];
pFrmBuf[2 * i - 1 * (i % LCD_WIDTH) + LCD_WIDTH] = pWord[i]; //图片相当于纵向拉伸了2倍,
//pFrmBuf[4 * i - 2 * (i % 160)] = pWord[i];
//pFrmBuf[4 * i - 2 * (i % 160) + 1] = pWord[i];
//pFrmBuf[4 * i - 2 * (i % 160) + 160 * 2] = pWord[i];
//pFrmBuf[4 * i - 2 * (i % 160) + 1 + 160 * 2] = pWord[i];
}
}
或者拷贝内存块填充显示缓存Framebuffer;
{
int i = 0;
PWORD p = (PWORD)InitialImage_rgb16_320x240;
PWORD dst = (PWORD)EBOOT_FRAMEBUFFER_UA_START;
for (i = 1;i <= LCD_HEIGHT;i++)
{
memcpy(dst, p, LCD_WIDTH*2);
if(i%2 == 0)
p += LCD_WIDTH;
dst += LCD_WIDTH;
}
}
然后编译eboot,下载烧录eboot。
2.图片格式为320*240 真彩色 用bmp2c转换后的图片数组为unsigned short 类型
{
int i;
unsigned int value_temp = 0;
unsigned int *pWord = (unsigned int)InitialImage_rgb16_320x240;
unsigned int *pFrmBuf = (unsigned int)EBOOT_FRAMEBUFFER_UA_START;
for(i = 0; i < LCD_WIDTH*LCD_HEIGHT; i++)
{
value_temp =(pWord[i]<<16) | pWord[i+1];
pFrmBuf[i/2] = value_temp;
i++;
//pFrmBuf[i] = pWord[i];
}
}
3,图片格式为320*240 真彩色 用Image2Lcd转换数组为unsiged char类型
// 图片数组为unsiged char类型,指向图片数组InitialImage_rgb16_320x240的指针pWord 为unsigned int类型,
// 从内存里取值是按int类型取值的,相当于取了4个char类型的值,而存放char类型数组是整块空间
{
int i;
unsigned int value_temp = 0;
unsigned int *pWord = (unsigned int)InitialImage_rgb16_320x240;
unsigned int *pFrmBuf = (unsigned int)EBOOT_FRAMEBUFFER_UA_START;
for(i = 0; i <LCD_WIDTH*LCD_HEIGHT ; i++)
{
// value_temp =(pWord[i]<<16) | (pWord[i+1]);
// pFrmBuf[i/2] = value_temp;
// i++;
pFrmBuf[i] = pWord[i];
}
}
或者直接拷贝内存分配给图片数组的数据
memcpy((void *)EBOOT_FRAMEBUFFER_UA_START, (void *)InitialImage_rgb16_320x240, 320*240*2);
总结:第1种和第二种方法效果不太好,因为涉及图片缩放,第三种效果比较满意,建议采取第三种方法。
http://blog.sina.com.cn/s/blog_7c42ed990100y75t.html