Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4471084
  • 博文数量: 1148
  • 博客积分: 25453
  • 博客等级: 上将
  • 技术积分: 11949
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-06 21:14
文章分类

全部博文(1148)

文章存档

2012年(15)

2011年(1078)

2010年(58)

分类: 嵌入式

2011-07-04 09:33:55

工程代码: 5_lcd显示图片.rar  


   为了实现从SD中读取图片数据,并且显示在LCD上。 这里首先实现了
直接读取图片数据,显示LCD上。
   图片16进制文件大小都 203KB了,生成的 hex文件 124KB
,flash大小总共才128KB

    
主要代码实现:

  1. void LCD_show_picture(const u8 *pic)
  2. {
  3.     int i,j,k;
  4.     unsigned char picH,picL;
  5.  
  6.     k=0;
  7.     for(i=0;i<128;i++)
  8.     {
  9.         for(j=0;j<160;j++)
  10.         {
  11.             picH=pic[k];
  12.             k++;
  13.             picL=pic[k];
  14.             k++;
  15.             LCD_DataWrite(picH,picL);
  16.         }
  17.     }
  18.         
  19. }

  1. #ifndef __PICTURE_H
  2. #define __PICTURE_H

  3. #include "stm32f10x.h"

  4. //SPI 彩屏图片数组
  5. extern const u8 Image_pic[];

  6. #endif

  1. #include "picture.h"

  2. const u8 Image_pic[]=
  3. {
  4. 0x42,0x04,0x52,0xA7,0x4A,0x86,0x3A,0x44,0x32,0x82,0x53,0x64,0x4B,0x43,0x3A,0xA3,0x2A,0x22,0x4B,0x04,0x42,0xE2,0x5B,0xC5,0x5B,0xA4,0x3A,0xA2,0x32,0x41,0x32,0x82,
  5. 0x4B,0x65,0x2A,0x41,0x42,0xC3,0x4B,0x23,0x53,0x64,0x53,0x65,0x42,0xA3,0x3A,0x62,0x4B,0x05,0x6C,0x29,0x64,0x08,0x4B,0x24,0x32,0xA2,0x64,0x28,0x6C,0x28,0x4A,0xE4,
  6. 0x53,0x06,0x3A,0x25,0x31,0xC2,0x4A,0xC4,0x73,0xE7,0x7C,0x28,0x73,0xC7,0x63,0x46,0x6B,0x88,0x5B,0x25,0x5B,0x66,0x52,0xE5,0x52,0xA5,0x5A,0xE6,0x42,0x02,0x6B,0x68,
  7. 0xA5,0x0E,0x94,0x6C,0x63,0x06,0x7B,0x6A,0x20,0x60,0x7B,0x49,0x72,0xE7,0x39,0x62,0x6B,0x47,0x4A,0x85,0x6B,0x66,0x42,0x02,0x63,0x86,0x5B,0x84,0x53,0x43,0x6C,0x26,
  8. 0x6
阅读(978) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~