// 正常状态关闭按钮PNG图片文件的二进制内容
unsigned char g_ucSysButtonCloseNormal[] = {
0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,0x00,0x00,0x00,0x27,0x00,0x00,0x00,0x14,0x08,0x06,0x00,0x00,0x00,0x0e,0x4d,0x24,0x36,0x00,0x00,0x00,0x09,0x70,0x48,0x59,0x73,0x00,0x00,0x0b,0x13,0x00,0x00,0x0b,0x13,0x01,0x00,0x9a,0x9c,0x18,0x00,0x00,0x0a,0x4d,0x69,0x43,0x43,0x50,0x50,0x68,0x6f,0x74,0x6f,0x73,0x68,0x6f,0x70,0x20,0x49,0x43,0x43,0x20,0x70,0x72,0x6f,0x66,0x69,0x6c,0x65,0x00,0x00,0x78,0xda,0x9d,0x53,0x77,0x58,0x93,0xf7,0x16,0x3e,0xdf,0xf7,0x65,0x0f,0x56,
0x42,0xd8,0xf0,0xb1,0x97,0x6c,0x81,0x00,0x22,0x23,0xac,0x08,0xc8,0x10,0x59,0xa2,0x10,0x92,0x00,0x61,0x84,0x10,0x12,0x40,0xc5,0x85,0x88,0x0a,0x56,0x14,0x15,0x11,0x9c,0x48,0x55,0xc4,0x82,0xd5,0x0a,0x48,0x9d,0x88,0xe2,0xa0,0x28,0xb8,0x67,0x41,0x8a,0x88,0x5a,0x8b,0x55,0x5c,0x38,0xee,0x1f,0xdc,0xa7,0xb5,0x7d,0x7a,0xef,0xed,0xed,0xfb,0xd7,0xfb,0xbc,0xe7,0x9c,0xe7,0xfc,0xce,0x79,0xcf,0x0f,0x80,0x11,0x12,0x26,0x91,0xe6,0xa2,0x6a,0x00,0x39,0x52,0x85,0x3c,0x3a,0xd8,0x1f,0x8f,0x4f,0x48,0xc4,0xc9,0xbd,0x80,
0x02,0x15,0x48,0xe0,0x04,0x20,0x10,0xe6,0xcb,0xc2,0x67,0x05,0xc5,0x00,0x00,0xf0,0x03,0x79,0x78,0x7e,0x74,0xb0,0x3f,0xfc,0x01,0xaf,0x6f,0x00,0x02,0x00,0x70,0xd5,0x2e,0x24,0x12,0xc7,0xe1,0xff,0x83,0xba,0x50,0x26,0x57,0x00,0x20,0x91,0x00,0xe0,0x22,0x12,0xe7,0x0b,0x01,0x90,0x52,0x00,0xc8,0x2e,0x54,0xc8,0x14,0x00,0xc8,0x18,0x00,0xb0,0x53,0xb3,0x64,0x0a,0x00,0x94,0x00,0x00,0x6c,0x79,0x7c,0x42,0x22,0x00,0xaa,0x0d,0x00,0xec,0xf4,0x49,0x3e,0x05,0x00,0xd8,0xa9,0x93,0xdc,0x17,0x00,0xd8,0xa2,0x1c,0xa9,0x08,
0x00,0x8d,0x01,0x00,0x99,0x28,0x47,0x24,0x02,0x40,0xbb,0x00,0x60,0x55,0x81,0x52,0x2c,0x02,0xc0,0xc2,0x00,0xa0,0xac,0x40,0x22,0x2e,0x04,0xc0,0xae,0x01,0x80,0x59,0xb6,0x32,0x47,0x02,0x80,0xbd,0x05,0x00,0x76,0x8e,0x58,0x90,0x0f,0x40,0x60,0x00,0x80,0x99,0x42,0x2c,0xcc,0x00,0x20,0x38,0x02,0x00,0x43,0x1e,0x13,0xcd,0x03,0x20,0x4c,0x03,0xa0,0x30,0xd2,0xbf,0xe0,0xa9,0x5f,0x70,0x85,0xb8,0x48,0x01,0x00,0xc0,0xcb,0x95,0xcd,0x97,0x4b,0xd2,0x33,0x14,0xb8,0x95,0xd0,0x1a,0x77,0xf2,0xf0,0xe0,0xe2,0x21,0xe2,0xc2,
0x6c,0xb1,0x42,0x61,0x17,0x29,0x10,0x66,0x09,0xe4,0x22,0x9c,0x97,0x9b,0x23,0x13,0x48,0xe7,0x03,0x4c,0xce,0x0c,0x00,0x00,0x1a,0xf9,0xd1,0xc1,0xfe,0x38,0x3f,0x90,0xe7,0xe6,0xe4,0xe1,0xe6,0x66,0xe7,0x6c,0xef,0xf4,0xc5,0xa2,0xfe,0x6b,0xf0,0x6f,0x22,0x3e,0x21,0xf1,0xdf,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0c,0xc1,0x14,0xac,0xc0,0x0e,0x9c,0xc1,0x1d,0xbc,0xc0,0x17,0x02,0x61,0x06,0x44,0x40,0x0c,0x24,0xc0,0x3c,0x10,0x42,
0x06,0xe4,0x80,0x1c,0x0a,0xa1,0x18,0x96,0x41,0x19,0x54,0xc0,0x3a,0xd8,0x04,0xb5,0xb0,0x03,0x1a,0xa0,0x11,0x9a,0xe1,0x10,0xb4,0xc1,0x31,0x38,0x0d,0xe7,0xe0,0x12,0x5c,0x81,0xeb,0x70,0x17,0x06,0x60,0x18,0x9e,0xc2,0x18,0xbc,0x86,0x09,0x04,0x41,0xc8,0x08,0x13,0x61,0x21,0x3a,0x88,0x11,0x62,0x8e,0xd8,0x22,0xce,0x08,0x17,0x99,0x8e,0x04,0x22,0x61,0x48,0x34,0x92,0x80,0xa4,0x20,0xe9,0x88,0x14,0x51,0x22,0xc5,0xc8,0x72,0xa4,0x02,0xa9,0x42,0x6a,0x91,0x5d,0x48,0x23,0xf2,0x2d,0x72,0x14,0x39,0x8d,0x5c,0x40,0xfa,
0x90,0xdb,0xc8,0x20,0x32,0x8a,0xfc,0x8a,0xbc,0x47,0x31,0x94,0x81,0xb2,0x51,0x03,0xd4,0x02,0x75,0x40,0xb9,0xa8,0x1f,0x1a,0x8a,0xc6,0xa0,0x73,0xd1,0x74,0x34,0x0f,0x5d,0x80,0x96,0xa2,0x6b,0xd1,0x1a,0xb4,0x1e,0x3d,0x80,0xb6,0xa2,0xa7,0xd1,0x4b,0xe8,0x75,0x74,0x00,0x7d,0x8a,0x8e,0x63,0x80,0xd1,0x31,0x0e,0x66,0x8c,0xd9,0x61,0x5c,0x8c,0x87,0x45,0x60,0x89,0x58,0x1a,0x26,0xc7,0x16,0x63,0xe5,0x58,0x35,0x56,0x8f,0x35,0x63,0x1d,0x58,0x37,0x76,0x15,0x1b,0xc0,0x9e,0x61,0xef,0x08,0x24,0x02,0x8b,0x80,0x13,0xec,
0x08,0x5e,0x84,0x10,0xc2,0x6c,0x82,0x90,0x90,0x47,0x58,0x4c,0x58,0x43,0xa8,0x25,0xec,0x23,0xb4,0x12,0xba,0x08,0x57,0x09,0x83,0x84,0x31,0xc2,0x27,0x22,0x93,0xa8,0x4f,0xb4,0x25,0x7a,0x12,0xf9,0xc4,0x78,0x62,0x3a,0xb1,0x90,0x58,0x46,0xac,0x26,0xee,0x21,0x1e,0x21,0x9e,0x25,0x5e,0x27,0x0e,0x13,0x5f,0x93,0x48,0x24,0x0e,0xc9,0x92,0xe4,0x4e,0x0a,0x21,0x25,0x90,0x32,0x49,0x0b,0x49,0x6b,0x48,0xdb,0x48,0x2d,0xa4,0x53,0xa4,0x3e,0xd2,0x10,0x69,0x9c,0x4c,0x26,0xeb,0x90,0x6d,0xc9,0xde,0xe4,0x08,0xb2,0x80,0xac,
0x20,0x97,0x91,0xb7,0x90,0x0f,0x90,0x4f,0x92,0xfb,0xc9,0xc3,0xe4,0xb7,0x14,0x3a,0xc5,0x88,0xe2,0x4c,0x09,0xa2,0x24,0x52,0xa4,0x94,0x12,0x4a,0x35,0x65,0x3f,0xe5,0x04,0xa5,0x9f,0x32,0x42,0x99,0xa0,0xaa,0x51,0xcd,0xa9,0x9e,0xd4,0x08,0xaa,0x88,0x3a,0x9f,0x5a,0x49,0x6d,0xa0,0x76,0x50,0x2f,0x53,0x87,0xa9,0x13,0x34,0x75,0x9a,0x25,0xcd,0x9b,0x16,0x43,0xcb,0xa4,0x2d,0xa3,0xd5,0xd0,0x9a,0x69,0x67,0x69,0xf7,0x68,0x2f,0xe9,0x74,0xba,0x09,0xdd,0x83,0x1e,0x45,0x97,0xd0,0x97,0xd2,0x6b,0xe8,0x07,0xe9,0xe7,0xe9,
0x83,0xf4,0x77,0x0c,0x0d,0x86,0x0d,0x83,0xc7,0x48,0x62,0x28,0x19,0x6b,0x19,0x7b,0x19,0xa7,0x18,0xb7,0x19,0x2f,0x99,0x4c,0xa6,0x05,0xd3,0x97,0x99,0xc8,0x54,0x30,0xd7,0x32,0x1b,0x99,0x67,0x98,0x0f,0x98,0x6f,0x55,0x58,0x2a,0xf6,0x2a,0x7c,0x15,0x91,0xca,0x12,0x95,0x3a,0x95,0x56,0x95,0x7e,0x95,0xe7,0xaa,0x54,0x55,0x73,0x55,0x3f,0xd5,0x79,0xaa,0x0b,0x54,0xab,0x55,0x0f,0xab,0x5e,0x56,0x7d,0xa6,0x46,0x55,0xb3,0x50,0xe3,0xa9,0x09,0xd4,0x16,0xab,0xd5,0xa9,0x1d,0x55,0xbb,0xa9,0x36,0xae,0xce,0x52,0x77,0x52,
0x8f,0x50,0xcf,0x51,0x5f,0xa3,0xbe,0x5f,0xfd,0x82,0xfa,0x63,0x0d,0xb2,0x86,0x85,0x46,0xa0,0x86,0x48,0xa3,0x54,0x63,0xb7,0xc6,0x19,0x8d,0x21,0x16,0xc6,0x32,0x65,0xf1,0x58,0x42,0xd6,0x72,0x56,0x03,0xeb,0x2c,0x6b,0x98,0x4d,0x62,0x5b,0xb2,0xf9,0xec,0x4c,0x76,0x05,0xfb,0x1b,0x76,0x2f,0x7b,0x4c,0x53,0x43,0x73,0xaa,0x66,0xac,0x66,0x91,0x66,0x9d,0xe6,0x71,0xcd,0x01,0x0e,0xc6,0xb1,0xe0,0xf0,0x39,0xd9,0x9c,0x4a,0xce,0x21,0xce,0x0d,0xce,0x7b,0x2d,0x03,0x2d,0x3f,0x2d,0xb1,0xd6,0x6a,0xad,0x66,0xad,0x7e,0xad,
0x37,0xda,0x7a,0xda,0xbe,0xda,0x62,0xed,0x72,0xed,0x16,0xed,0xeb,0xda,0xef,0x75,0x70,0x9d,0x40,0x9d,0x2c,0x9d,0xf5,0x3a,0x6d,0x3a,0xf7,0x75,0x09,0xba,0x36,0xba,0x51,0xba,0x85,0xba,0xdb,0x75,0xcf,0xea,0x3e,0xd3,0x63,0xeb,0x79,0xe9,0x09,0xf5,0xca,0xf5,0x0e,0xe9,0xdd,0xd1,0x47,0xf5,0x6d,0xf4,0xa3,0xf5,0x17,0xea,0xef,0xd6,0xef,0xd1,0x1f,0x37,0x30,0x34,0x08,0x36,0x90,0x19,0x6c,0x31,0x38,0x63,0xf0,0xcc,0x9

解决方案 »

  1.   

    你如何将txt里的数据改变成png格式的?为何不直接读取数组中的数据呢?
      

  2.   

    要分析png格式
    BOOL CVcOpenPNG::IsValidSignature(BYTE Signature[])
    {
    if(Signature[0] != 137) return FALSE;//0x89
    if(Signature[1] != 80 ) return FALSE;//0x50='P'
    if(Signature[2] != 78 ) return FALSE;//0x4E='N'
    if(Signature[3] != 71 ) return FALSE;//0x47='G'
    if(Signature[4] != 13 ) return FALSE;//0x0D
    if(Signature[5] != 10 ) return FALSE;//0x0A
    if(Signature[6] != 26 ) return FALSE;//0x1A
    if(Signature[7] != 10 ) return FALSE;//0x0A
    return TRUE;
    }
      

  3.   

    下载“vcopenpng.zip”
    http://download.csdn.net/detail/schlafenhamster/3684682
      

  4.   

    我把数组数据复制.txt里,咋不对呀?png不是这种格式的数据吗?????怎么程序里就可以直接使用???
      

  5.   


    _cvUpdateMotionHistory//opencv2.3.2如何使用这个函数??????大哥急救
      

  6.   


    我把数组数据复制.txt里,咋不对呀?png不是这种格式的数据吗?????怎么程序里就可以直接使用???
      

  7.   

    “数组数据复制.txt里”
    2种文件不是 一个格式。
    txt 是给人看的,所以是 ASCII
    数组里数据 是 二进制 格式。是给机器看的。
    要把 binary 转换到 hex
      

  8.   

    你可以把 数组 按 二进制 写到文件, 文件名 为 xx.png.
    不是什么 txt
      

  9.   

    png 文件本身就是 binary 的。
    你可以 用 ue 按 Hex 显示。
    自己 转换 成 ascii 的 也可以。
      

  10.   


    //把下面复制到txt 后改成.png还是显示不出来
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0
      

  11.   

    这样说吧:你在cpp里看到:
    unsigned char g_ucSysButtonCloseNormal[] = {
        0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,
    是因为每个字母都是 ascii 。
    但编译后 g_ucSysButtonCloseNormal[] 里都是二进制数。
    如 "89" ascii 是 ‘8’(=48+8)‘9’(=48+9) 2个 字节,编译器 把'89' 变成 一个字节
    (137) //0x89
    所以在程序使用 g_ucSysButtonCloseNormal[] 是二进制的数组,你可以把他直接写入到一个.png 文件。
    如果你 拷贝:
        0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,
    到剪贴板, 然后 粘贴到 一个新文件 .txt ,你得到 g_ucSysButtonCloseNormal[] 的 ascii 表示方法。  
      

  12.   

    我写入 .png 可以 ;为什么拷贝就不行呢??????
      

  13.   

    ”如果你 拷贝:
        0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,
    到剪贴板, 然后 粘贴到 一个新文件 .txt ,你得到 g_ucSysButtonCloseNormal[] 的 ascii 表示方法。“
    这是一个 txt 文件, 你要像编译器做的那样,把它转换为 binary 数组才能当 png 文件。
      

  14.   

    上面我不是复制一个二进制的关闭按钮的png图片呢 咋格式还不对吗?????
      

  15.   

    “上面我不是复制一个二进制的关闭按钮的png图片呢”
    不明白你怎么“复制”的,你可以 把 png 加入到 资源,然后 打开看看 这个资源是怎么 显示的。
      

  16.   

    13楼 就是一个二进制png呀 
      

  17.   

    13楼不是一个二进制png, 只是这个 png 的 txt 表示。而且 格式也 不对 !参考 #3 ,那是 png 的 头几个 字节。
      

  18.   

    “vcopenpng.zip” 里不是有格式 吗, 你要 修改 png 现在 可以 用 “绘图”,他可以打开和保存 png 文件。