初级会员
- 积分
- 160
- 金钱
- 160
- 注册时间
- 2015-1-16
- 在线时间
- 11 小时
|
5金钱
#include "liuweitushiyan.h"
#include "BUTTON.h"
#include "malloc.h"
#define Method1 /* ??????????? */
static FIL BMPFile;
/*
*********************************************************************************************************
* ? ? ?: _ShowStreamBitmap
* ????: ?????
* ? ?:sFilename ???????
* ? ? ?: ?
*********************************************************************************************************
*/
static void _ShowStreamBitmap(u8 *sFilename)
{
GUI_HMEM hMem;
char *_acBuffer2;
BUTTON_Handle hButton;
char *bmpbuffer;
GUI_BITMAP Bitmap;
GUI_LOGPALETTE Palette;
FRESULT result;
/* ?????? */
hButton = BUTTON_Create(100, 100, 200, 200, GUI_ID_OK, WM_CF_SHOW);
/* ???????? ?????? */
// hMem = GUI_ALLOC_AllocZero(1024*200);
/* ???????????????? */
//_acBuffer2 = GUI_ALLOC_h2p(hMem);
/* ???? */
result = f_open(&BMPFile, (const TCHAR*)sFilename, FA_OPEN_EXISTING | FA_READ | FA_OPEN_ALWAYS);
if (result != FR_OK)
{
return;
}
bmpbuffer=mymalloc(SRAMEX,BMPFile.fsize); //??memp_memory?ê??????
/* ????????? */
result = f_read(&BMPFile,bmpbuffer, file->fsize, &bw);
if (result != FR_OK)
{
return;
}
/* ????? */
#if defined Method1
GUI_DrawStreamedBitmapAuto(bmpbuffer, 15, 15);
/* ????? */
#elif defined Method2
GUI_CreateBitmapFromStream(&Bitmap, &alette, bmpbuffer);
GUI_DrawBitmap(&Bitmap, 15, 15);
/* ????? */
#elif defined Method3
GUI_CreateBitmapFromStream565(&Bitmap, &alette, bmpbuffer);
GUI_DrawBitmap(&Bitmap, 15, 15);
#endif
/* ????????????,?????? */
// BUTTON_SetStreamedBitmap(hButton, BUTTON_CI_UNPRESSED, (const GUI_BITMAP_STREAM *)&Bitmap);
// BUTTON_SetBitmap(hButton, BUTTON_BI_UNPRESSED, &Bitmap);
// BUTTON_SetStreamedBitmapEx(hButton, BUTTON_BI_UNPRESSED, (const GUI_BITMAP_STREAM *)&Bitmap,0,0);
/* ?????? */
myfree(SRAMEX,bmpbuffer);
//GUI_ALLOC_Free(hMem);
f_close(&BMPFile);
}
/*
*********************************************************************************************************
* ? ? ?: MainTask
* ????: GUI???
* ? ?:?
* ? ? ?: ?
*********************************************************************************************************
*/
void liuweitushiyan(void)
{
GUI_Init();
//PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX);
//FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX);
//PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX);
//BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX);
//CHECKBOX_SetDefaultSkin(CHECKBOX_SKIN_FLEX);
//DROPDOWN_SetDefaultSkin(DROPDOWN_SKIN_FLEX);
//SCROLLBAR_SetDefaultSkin(SCROLLBAR_SKIN_FLEX);
//SLIDER_SetDefaultSkin(SLIDER_SKIN_FLEX);
//HEADER_SetDefaultSkin(HEADER_SKIN_FLEX);
//RADIO_SetDefaultSkin(RADIO_SKIN_FLEX);
_ShowStreamBitmap("0:/PICTURE/BMP/dianhua.dat");
while(1)
{
//_ShowStreamBitmap("dianhua.dta");
GUI_Delay(100);
}
}
改了一个流位图显示的程序,一直显示不了,大家帮我看一下,哪里出问题了
|
-
|