高级会员
- 积分
- 713
- 金钱
- 713
- 注册时间
- 2016-6-29
- 在线时间
- 165 小时
|
1金钱
我的LCD像素格式为ARGB,图片也是用BmpCvtST.exe软件生成的ARGB,但是显示出来有点不对 ,偏黑 就解决,格式为GUI_DRAW_BMP8888
- pathAndName = rt_memheap_alloc(&extMemoryHeap,DIR_LENGTH);
- fileInfo = (FILINFO *)rt_memheap_alloc(&extMemoryHeap,sizeof(FILINFO));
- optFile = (FIL *)rt_memheap_alloc(&extMemoryHeap,sizeof(FIL));
- rt_memset(pathAndName,0x00,DIR_LENGTH);
- strcat(pathAndName,SD_DISK);
- strcat(pathAndName,sysParaSave.picTakeCar.background.path);
- strcat(pathAndName,sysParaSave.picTakeCar.background.name);
- if(f_open(optFile,pathAndName,FA_READ)!=FR_OK)
- {
- }
- if(f_stat(pathAndName,fileInfo)!=FR_OK)//获取复制进去的文件的尺寸看看更新成功没
- {
- }
- buf = rt_memheap_alloc(&extMemoryHeap,fileInfo->fsize);
- u32 br;
- if(f_read(optFile,buf,fileInfo->fsize,&br)!=FR_OK)
- {
- }
- background.BitsPerPixel=sysParaSave.picTakeCar.background.perPixelByte;
- background.BytesPerLine = sysParaSave.picTakeCar.background.perLineByte;
- background.XSize = sysParaSave.picTakeCar.background.xSize;
- background.YSize = sysParaSave.picTakeCar.background.ySize;
- background.pData = buf;
- background.pPal = NULL;
- if(strstr(sysParaSave.picTakeCar.background.pictureFormat,"GUI_DRAW_BMP8888")!=NULL)
- background.pMethods = GUI_DRAW_BMP8888;
- else if(strstr(sysParaSave.picTakeCar.background.pictureFormat,"GUI_DRAW_BMP565")!=NULL)
- background.pMethods = GUI_DRAW_BMP565;
- GUI_DrawBitmapHWAlpha(&background,0,0);
- rt_memheap_free(optFile);
- rt_memheap_free(fileInfo);
- rt_memheap_free(pathAndName);
- rt_memheap_free(buf);
复制代码
|
|