5499|16

64

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

关于固化在硬件上的图片取出问题 [复制链接]

各位大侠大哥你们好,小弟近日在做界面修改时,发现界面上的图片都是通过bmptobin.exe去生成相应的*.h文件的,现在我想将图片从器件中拿出来,做修改后再放回去,我找了一些方法,但是网上介绍的说可以通过bintobmp和reEdit这个软件可以将里面的数据图片导出来,然后修改后有导入进去。可是我试试,这两个软件都不行,尤其是bintobmp这个软件连运行都是问题。
在这里请教给位大哥了,看看能有什么办法可以解决?或者用什么工具

最新回复

谢谢schlafenhamster了,太感谢了,谢谢你百忙之中帮我解释。  详情 回复 发表于 2010-5-17 21:29
点赞 关注

回复
举报

62

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
相应的*.h文件是什么格式?
 
 

回复

76

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
问题是,你的是什么器件?什么平台下?这个很重要的。*.H应该就是存放图片数组的头文件是吧?
 
 
 

回复

72

帖子

0

TA的资源

一粒金砂(初级)

4
 
回复二楼的大侠,是在linux平台下的,*.h确实是存放图片数组的头文件
下面的这个图片数组文件是通过bmptobin.exe这个程序生成的,我现在想把它还原到*.bmp格式(原图片没有)
Im_loading.h
/*
E:\Glass\Bitmap\Im_Loading.h
        bmp file size:                2680
        bmp data offset:        1078
        bmp data width:                40
        bmp data height:        40
        bmp data size:                1600
        RLE bmp data size:        818
*/


const unsigned char Im_Loading[] __attribute__((section(".flash"))) =
{
0x5a,0xff,0x94,0x3b,0x0e,0x03,0x03,0x01,0x03,0x03,0x01,0x03,0x03,0x01,0x03,0x03,
0x01,0x03,0x03,0x01,0x03,0x0e,0x3b,0x13,0xff,0x96,0x0d,0x03,0x01,0x03,0x01,0x03,
0x03,0x01,0x03,0x03,0x01,0x03,0x03,0x01,0x03,0x03,0x01,0x03,0x03,0x03,0x01,0x0d,
0x11,0xff,0x98,0x22,0x03,0x0d,0x25,0x25,0x31,0x25,0x31,0x31,0x25,0x31,0x31,0x25,
0x31,0x31,0x25,0x31,0x31,0x25,0x25,0x25,0x0d,0x03,0x22,0x10,0xff,0x86,0x03,0x01,
0x25,0x1c,0x1c,0x25,0x06,0x1c,0x82,0x25,0x1c,0x05,0x25,0x85,0x31,0x25,0x25,0x01,
0x0d,0x10,0xff,0x98,0x03,0x03,0x25,0x05,0x0d,0x05,0x0d,0x05,0x0d,0x05,0x0d,0x05,
0x05,0x0d,0x13,0x13,0x1c,0x1c,0x25,0x25,0x31,0x31,0x03,0x01,0x10,0xff,0x8a,0x0d,
0x01,0x25,0x31,0x31,0x4a,0x56,0x64,0x64,0x67,0x05,0x31,0x89,0x2c,0x31,0x31,0x31,
0x25,0x31,0x25,0x01,0x0d,0x10,0xff,0x98,0x22,0x03,0x0d,0x25,0x31,0x64,0x7a,0x64,
0x7a,0x7a,0x31,0x31,0x25,0x31,0x31,0x31,0x25,0x31,0x2c,0x31,0x2c,0x0d,0x03,0x22,
0x11,0xff,0x89,0x03,0x03,0x25,0x31,0x64,0x64,0x7a,0x64,0x64,0x08,0x31,0x85,0x25,
0x31,0x25,0x03,0x03,0x12,0xff,0x8e,0x03,0x03,0x25,0x2c,0x64,0x7a,0x78,0x7a,0x7a,
0x42,0x42,0x42,0x31,0x42,0x05,0x31,0x83,0x25,0x01,0x03,0x12,0xff,0x89,0x03,0x01,
0x25,0x31,0x64,0x64,0x7a,0x7a,0x64,0x08,0x42,0x85,0x31,0x31,0x30,0x03,0x03,0x12,
0xff,0x8a,0x03,0x03,0x31,0x31,0x64,0x7a,0x64,0x64,0x7a,0x4a,0x06,0x42,0x86,0x31,
0x42,0x31,0x2c,0x03,0x03,0x12,0xff,0x96,0x03,0x01,0x30,0x31,0x64,0x7a,0x7a,0x78,
0x7a,0x4b,0x50,0x50,0x50,0x4b,0x4b,0x42,0x42,0x42,0x31,0x31,0x01,0x03,0x12,0xff,
0x96,0x03,0x03,0x31,0x31,0x31,0x64,0x64,0x7a,0x64,0x25,0x2b,0x25,0x2b,0x25,0x2b,
0x25,0x2b,0x42,0x42,0x30,0x03,0x03,0x12,0xff,0x8a,0x22,0x03,0x0d,0x31,0x42,0x4a,
0x64,0x7a,0x67,0x25,0x05,0x15,0x87,0x42,0x4b,0x42,0x42,0x0d,0x03,0x22,0x13,0xff,
0x94,0x03,0x03,0x03,0x30,0x4b,0x4b,0x57,0x64,0x42,0x15,0x25,0x15,0x31,0x59,0x59,
0x50,0x30,0x03,0x03,0x03,0x15,0xff,0x92,0x22,0x03,0x01,0x22,0x50,0x5d,0x50,0x4a,
0x15,0x25,0x52,0x66,0x5d,0x56,0x1c,0x03,0x01,0x22,0x17,0xff,0x90,0x3b,0x03,0x03,
0x0d,0x4a,0x5d,0x5e,0x42,0x67,0x67,0x5d,0x52,0x0d,0x01,0x03,0x3b,0x19,0xff,0x8e,
0x6b,0x0e,0x01,0x03,0x30,0x67,0x67,0x71,0x67,0x30,0x03,0x01,0x22,0x6e,0x1c,0xff,
0x8a,0x22,0x03,0x03,0x30,0x67,0x67,0x25,0x03,0x01,0x22,0x1c,0xff,0x8e,0x63,0x0e,
0x03,0x03,0x30,0x5d,0x67,0x67,0x67,0x30,0x03,0x03,0x0e,0x6e,0x19,0xff,0x85,0x22,
0x03,0x03,0x0d,0x4a,0x06,0x5d,0x85,0x49,0x0d,0x03,0x03,0x22,0x17,0xff,0x88,0x22,
0x03,0x03,0x22,0x52,0x50,0x5d,0x64,0x04,0x5d,0x86,0x56,0x50,0x22,0x01,0x03,0x22,
0x15,0xff,0x94,0x03,0x01,0x03,0x30,0x42,0x42,0x64,0x7a,0x64,0x59,0x56,0x59,0x50,
0x50,0x4b,0x4b,0x30,0x03,0x03,0x03,0x13,0xff,0x96,0x22,0x03,0x0d,0x31,0x31,0x42,
0x64,0x7a,0x64,0x50,0x4b,0x50,0x4b,0x50,0x4b,0x42,0x42,0x42,0x31,0x0d,0x03,0x22,
0x12,0xff,0x96,0x03,0x01,0x31,0x31,0x42,0x64,0x64,0x7a,0x64,0x31,0x15,0x42,0x4b,
0x42,0x42,0x42,0x31,0x42,0x31,0x30,0x01,0x03,0x12,0xff,0x90,0x03,0x03,0x25,0x31,
0x64,0x7a,0x7a,0x64,0x7a,0x15,0x25,0x15,0x31,0x42,0x42,0x42,0x04,0x31,0x82,0x03,
0x03,0x12,0xff,0x8e,0x03,0x01,0x31,0x25,0x64,0x64,0x7a,0x78,0x7a,0x25,0x15,0x15,
0x15,0x25,0x05,0x31,0x83,0x25,0x01,0x03,0x12,0xff,0x96,0x03,0x03,0x25,0x31,0x64,
0x7a,0x64,0x7a,0x64,0x30,0x15,0x25,0x15,0x15,0x25,0x31,0x31,0x31,0x25,0x31,0x03,
0x03,0x12,0xff,0x96,0x06,0x03,0x25,0x31,0x64,0x64,0x7a,0x64,0x7a,0x15,0x25,0x15,
0x15,0x25,0x15,0x15,0x25,0x31,0x31,0x25,0x01,0x03,0x11,0xff,0x98,0x22,0x03,0x0d,
0x31,0x25,0x64,0x7a,0x78,0x7a,0x7a,0x25,0x15,0x15,0x25,0x15,0x25,0x15,0x25,0x25,
0x2c,0x31,0x0d,0x03,0x22,0x10,0xff,0x98,0x03,0x03,0x25,0x25,0x15,0x4a,0x4a,0x3b,
0x31,0x4a,0x1c,0x25,0x25,0x15,0x25,0x15,0x25,0x25,0x15,0x31,0x31,0x25,0x03,0x03,
0x10,0xff,0x91,0x03,0x01,0x25,0x05,0x0d,0x05,0x05,0x05,0x0d,0x05,0x05,0x03,0x05,
0x13,0x13,0x13,0x1c,0x04,0x25,0x83,0x31,0x01,0x03,0x10,0xff,0x82,0x11,0x03,0x11,
0x25,0x85,0x31,0x31,0x25,0x03,0x0d,0x10,0xff,0x8e,0x22,0x01,0x0d,0x25,0x31,0x25,
0x31,0x2c,0x31,0x25,0x31,0x31,0x31,0x2c,0x05,0x31,0x85,0x25,0x25,0x0d,0x01,0x22,
0x11,0xff,0x96,0x0d,0x03,0x01,0x03,0x01,0x03,0x01,0x03,0x03,0x01,0x03,0x01,0x03,
0x01,0x03,0x01,0x03,0x01,0x03,0x01,0x03,0x11,0x13,0xff,0x94,0x35,0x0d,0x03,0x03,
0x01,0x03,0x01,0x03,0x03,0x01,0x03,0x01,0x03,0x01,0x03,0x01,0x03,0x03,0x11,0x30,
0x5a,0xff
};
 
 
 

回复

86

帖子

0

TA的资源

一粒金砂(初级)

5
 
还有就是器件为机顶盒
 
 
 

回复

80

帖子

0

TA的资源

一粒金砂(初级)

6
 
bmp file size: 2680
bmp data offset: 1078
bmp data width: 40
bmp data height: 40
bmp data size: 1600
RLE bmp data size: 818
这些信息用于产生bmphead
const unsigned char Im_Loading[] 是数据
 
 
 

回复

69

帖子

0

TA的资源

一粒金砂(初级)

7
 
那怎么将这些数据再次转换成图片?
 
 
 

回复

57

帖子

0

TA的资源

一粒金砂(初级)

8
 
学习一下
 
 
 

回复

73

帖子

0

TA的资源

一粒金砂(初级)

9
 
画点呗,你没看是点阵数据啊.
 
 
 

回复

74

帖子

0

TA的资源

一粒金砂(初级)

10
 
知道是点阵,可是怎么修改啊,这个点阵代表的是一幅图片,那我要修改这幅图的话,难道我要一个一个的去修改这些点?
 
 
 

回复

79

帖子

0

TA的资源

一粒金砂(初级)

11
 
明白你的意思了,假如是黑白的点阵图,还好转换。假如是彩色的,那我就不知道用什么软件可以还原了,呵呵。只能求助网络了,看看有没有这样的软件,可以还原的。
 
 
 

回复

69

帖子

0

TA的资源

一粒金砂(初级)

12
 
用信息写bmphead把数据放好,写成“.bmp"文件,在“paint”就可以修改
 
 
 

回复

83

帖子

0

TA的资源

一粒金砂(中级)

13
 
是彩色的图片,黑白的可以用软件转换。
11楼的兄弟能否说的详细点?
 
 
 

回复

75

帖子

0

TA的资源

一粒金砂(初级)

14
 
//一下难以说清楚,下面是知道数据,用16色画图的办法。
void CDrawbmpView::OnDraw(CDC* pDC)
{
        CDrawbmpDoc* pDoc = GetDocument();
        ASSERT_VALID(pDoc);
        // TODO: add draw code for native data here
        int hei=480;
        int wid=640;

        int count,ofs;
        BYTE *ScreenPtr0=0;
        BYTE *ScreenPtr=0;
        COLORREF color_table[16]={// 0x00bbggrr
                                0x000000,  //0
                                0x000080,  //1
                                0x008000,  //2
                                0x008080,  //3
                                0x800000,  //4
                                0x800080,  //5
                                0x808000,  //6
                                0x808080,  //7
                                0xC0C0C0,  //8
                                0x0000FF,  //9
                                0x00FF00,  //10
                                0x00FFFF,  //11
                                0xFF0000,  //12
                                0xFF00FF,  //13
                                0xFFFF00,  //14
                                0xFFFFFF };//15
// open
        CFile if_hnd;
        if(!if_hnd.Open("tmp.bmp",CFile::modeRead|CFile::shareExclusive))
        {
                AfxMessageBox("Cann't open image file!");
                return;
        }
// get mem
        unsigned fsize;
        fsize =if_hnd.GetLength();//
        ScreenPtr0=(BYTE *)new char[fsize];  //
        // read all in
        if_hnd.Read(ScreenPtr0,fsize);//
// image data are in buffer
        if(if_hnd) if_hnd.Close();
        int count1=0;
//
        for (count1=0; count1         {// draw from bottom
                ScreenPtr=ScreenPtr0+fsize-(count1+1)*wid/2;//
                for (count=0;count                 {
                        ofs=(ScreenPtr[count]>>4) & 0x0F;
                        SetPixel(pDC->m_hDC,2*count,count1,color_table[ofs]);
                //
                        ofs=ScreenPtr[count] & 0x0F;
                        SetPixel(pDC->m_hDC,2*count+1,count1,color_table[ofs]);
                }
        }
        if(ScreenPtr0) delete []ScreenPtr0;
}
 
 
 

回复

79

帖子

0

TA的资源

一粒金砂(初级)

15
 
用你的数据试了试,发现你的818长的数据不是标准的RLE8。生成。bmp后“paint。exe”不能显示,(一个白矩形)
 
 
 

回复

57

帖子

0

TA的资源

一粒金砂(初级)

16
 
把test程序给你:
UINT RGB256Table[256]={0};//初始化为空,需要从任何一个256色的bmp中读入
void WriteBMP()
{
        BITMAPFILEHEADER bmpHead;
        BITMAPINFOHEADER  bmpInfoHead;
        memset(&bmpHead,0,sizeof(bmpHead));
        bmpHead.bfType=0x4D42;//BM
        bmpHead.bfSize=sizeof(bmpHead)+sizeof(bmpInfoHead)+256*sizeof(RGBQUAD)+sizeof(Your_Bits);
        bmpHead.bfOffBits=sizeof(bmpHead)+sizeof(bmpInfoHead)+256*sizeof(RGBQUAD);
//
        memset(&bmpInfoHead,0,sizeof(BITMAPINFOHEADER));
        bmpInfoHead.biSize=sizeof(BITMAPINFOHEADER);
        bmpInfoHead.biPlanes=1;
        bmpInfoHead.biBitCount=8;
        bmpInfoHead.biCompression=BI_RLE8;       
        bmpInfoHead.biClrImportant=256;
        bmpInfoHead.biClrUsed=256;
//
        bmpInfoHead.biHeight=40;//就是你的h文件中的数据
        bmpInfoHead.biWidth=40;
        bmpInfoHead.biSizeImage=sizeof(Your_Bits);//即你的RLE8数据
//
        FILE *bmp;
// read 256 color in 只读256色
        bmp=fopen("256clr.bmp","rb");//any bmp has 256 colors
        fseek(bmp,sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER),SEEK_SET);
        fread(RGB256Table,sizeof(RGB256Table),1,bmp);
        fclose(bmp);
//write  new bmp
        bmp=fopen("YourTest.bmp","wb");
        fwrite(&bmpHead,sizeof(bmpHead),1,bmp);
        fwrite(&bmpInfoHead,sizeof(bmpInfoHead),1,bmp);
        fwrite(RGB256Table,sizeof(RGB256Table),1,bmp);
        fwrite(Your_Bits,sizeof(Your_Bits),1,bmp);
        fclose(bmp);
}
//正常时用paintbrush可以打开,可惜你的data又经过某种处理了。
 
 
 

回复

92

帖子

0

TA的资源

纯净的硅(中级)

17
 
谢谢schlafenhamster了,太感谢了,谢谢你百忙之中帮我解释。
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/8 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表