⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 res_show.c

📁 智原mp3 SDK 开发包 与巨力 有mp3 wma ogg decoder
💻 C
字号:
#include <string.h>
#include "api.h"
#include "lcd.h"
#include "key.h"
#include "common.h"
#include "res_show.h"
#include "prefer.h"


#define IMAGE_OFFSET 268224L

RES_ENTRY_T res_entry; 
extern UINT16 pixel_buf[];
extern void delay(UINT16 n);
INT8U res_buf[50];

BOOLEAN  bResShowPic(INT16U id,INT8U x,INT8U y)
{
	INT16U width,high,length;
	INT16U count;
	UINT16 pitch;	
	INT8U buf1[32];		
	
	api_bSectionFileOpen(SYS_IMAGE_FILEID);
	api_bSectionFileSeek(id * sizeof(RES_ENTRY_T)+IMAGE_OFFSET, SEEK_SET);		 
	api_u16SectionFileRead(buf1, sizeof(RES_ENTRY_T));
	res_entry.u32Offset = (INT32U)buf1[0] | ((INT32U)buf1[1]<<8) | ((INT32U)buf1[2]<<16) | ((INT32U)buf1[3]<<24); 
	api_bSectionFileSeek(res_entry.u32Offset+IMAGE_OFFSET, SEEK_SET);		
	api_u16SectionFileRead(buf1,4);		
	width = buf1[0] | (buf1[1]<<8);
	high = buf1[2] | (buf1[3]<<8);	
		
	lcd_set_disply_mode(0x00,0x22);
	
	lcd_set_rw_area(x,y,(INT8U)width,(INT8U)high);
	pitch = (UINT16)width*4;
	
	length = width * high*2;
	
	if(length<512)
	{
		api_u16SectionFileRead(pixel_buf,length);
		lcd_put_data((UINT16)pixel_buf,length);
	}
	else
	{
		count = length/512;
		while(count--)
		{
			api_u16SectionFileRead(pixel_buf,512);
			lcd_put_data((UINT16)pixel_buf,512);
		}
		pitch = length%512;
		api_u16SectionFileRead(pixel_buf,pitch);
		lcd_put_data((UINT16)pixel_buf,pitch);			
	}
	return TRUE;	
}
	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -