OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 3561|回复: 3

ICONVIEW背景图片更改问题

[复制链接]

4

主题

11

帖子

0

精华

初级会员

Rank: 2

积分
87
金钱
87
注册时间
2019-3-6
在线时间
21 小时
发表于 2019-4-1 17:17:23 | 显示全部楼层 |阅读模式
1金钱
我想换个背景,怎么更改?方便解释一下下面程序吗
#include "background.h"
#include <stdlib.h>
#include "GUI.h"
//////////////////////////////////////////////////////////////////////////////////         
//本程序只供学习使用,未经作者许可,不得用于其它任何用途
//ALIENTEK STM32开发板
//STemwin ICONVIEW控件背景图片
//正点原子@ALIENTEK
//技术论坛:file:///C:\Documents and Settings\Administrator\Application Data\Tencent\QQ\Temp\%W@GJ$ACOF(TYDYECOKVDYB.pngwww.openedv.com
//创建日期:2016/3/21
//版本:V1.0
//版权所有,盗版必究。
//Copyright(C) 广州市星翼电子科技有限公司 2014-2024
//All rights reserved                                                                          
//////////////////////////////////////////////////////////////////////////////////


/*********************************************************************
*
*       Palette
*
*  Description
*    The following are the entries of the palette table.
*    The entries are stored as a 32-bit values of which 24 bits are
*    actually used according to the following bit mask: 0xBBGGRR
*
*    The lower   8 bits represent the Red   component.
*    The middle  8 bits represent the Green component.
*    The highest 8 bits represent the Blue  component.
*/
static GUI_CONST_STORAGE GUI_COLOR _Colorsbackground3[] = {
  0xA0AED2, 0xB0EEF8, 0x9AE7FC, 0x97D8F8,
  0xA5E9FA, 0xA4F3FD, 0xA4D7E7, 0x9BB8C6,
  0x97C8F7, 0x9CF3FD, 0xA7D7D8, 0x9CC7E8,
  0x99B7D7, 0xA2DAF6, 0xA3C8C7, 0x877976,
  0x97A8B8, 0x888688, 0xAAE4E9, 0xACDBBB,
  0x878896, 0xA2C9D6, 0x8DC6F6, 0xABD4BA,
。。。。。。。。
}
static GUI_CONST_STORAGE GUI_LOGPALETTE _Palbackground3 = {
  256,  // Number of entries
  0,    // No transparency
  &_Colorsbackground3[0]
};



static GUI_CONST_STORAGE unsigned char _acbackground3[] = {
  /* RLE: 024 Pixels @ 000,000 */ 24, 0x72,
  /* RLE: 016 Pixels @ 024,000 */ 16, 0x78,
  /* RLE: 029 Pixels @ 040,000 */ 29, 0x72,
  /* RLE: 007 Pixels @ 069,000 */ 7, 0x78,
  /* RLE: 004 Pixels @ 076,000 */ 4, 0x13,
  /* ABS: 003 Pixels @ 080,000 */ 0, 3, 0x78, 0x13, 0x13,
  /* RLE: 004 Pixels @ 083,000 */ 4, 0x78,
  /* ABS: 009 Pixels @ 087,000 */ 0, 9, 0x13, 0x72, 0x72, 0x78, 0x78, 0x78, 0x13, 0x13, 0x13,
  /* RLE: 032 Pixels @ 096,000 */ 32, 0x55,
  /* RLE: 008 Pixels @ 128,000 */ 8, 0x13,
  /* RLE: 028 Pixels @ 136,000 */ 28, 0x55,
  /* RLE: 028 Pixels @ 164,000 */ 28, 0x9E,
  /* RLE: 064 Pixels @ 192,000 */ 64, 0x55,
  /* RLE: 010 Pixels @ 256,000 */ 10, 0x17,
  /* RLE: 034 Pixels @ 266,000 */ 34, 0x2C,
  /* RLE: 010 Pixels @ 300,000 */ 10, 0x58,
  /* ABS: 002 Pixels @ 310,000 */ 0, 2, 0x17, 0x17,
  /* RLE: 020 Pixels @ 312,000 */ 20, 0x58,
  /* ABS: 002 Pixels @ 332,000 */ 0, 2, 0x2C, 0x2C,
  /* RLE: 006 Pixels @ 334,000 */ 6, 0x2A,
  /* ABS: 004 Pixels @ 340,000 */ 0, 4, 0x58, 0x2A, 0x2A, 0x58,
  /* RLE: 032 Pixels @ 344,000 */ 32, 0x2A,
  /* ABS: 006 Pixels @ 376,000 */ 0, 6, 0x71, 0x2A, 0x2A, 0x38, 0x2B, 0x2B,
  /* RLE: 006 Pixels @ 382,000 */ 6, 0x2A,
  /* RLE: 012 Pixels @ 388,000 */ 12, 0x51,
  /* RLE: 012 Pixels @ 400,000 */ 12, 0x81,
  /* RLE: 004 Pixels @ 412,000 */ 4, 0x2A,
  /* RLE: 004 Pixels @ 416,000 */ 4, 0x81,
  /* RLE: 016 Pixels @ 420,000 */ 16, 0x59,
  /* RLE: 047 Pixels @ 436,000 */ 47, 0x68,
  /* RLE: 004 Pixels @ 483,000 */ 4, 0x7F,
  /* ABS: 002 Pixels @ 487,000 */ 0, 2, 0x26, 0x68,
  /* RLE: 007 Pixels @ 489,000 */ 7, 0x7F,
  /* ABS: 003 Pixels @ 496,000 */ 0, 3, 0x3A, 0x68, 0x68,
  /* RLE: 005 Pixels @ 499,000 */ 5, 0x7F,
  /* RLE: 060 Pixels @ 504,000 */ 60, 0x26,
  /* RLE: 012 Pixels @ 564,000 */ 12, 0x88,
  /* RLE: 040 Pixels @ 576,000 */ 40, 0x4C,
  /* RLE: 001 Pixels @ 616,000 */ 1, 0x94,
  /* RLE: 007 Pixels @ 617,000 */ 7, 0x4C,
  /* ABS: 002 Pixels @ 624,000 */ 0, 2, 0x41, 0x4F,
  /* RLE: 015 Pixels @ 626,000 */ 15, 0xB2,
  /* RLE: 013 Pixels @ 641,000 */ 13, 0x4F,
  /* ABS: 002 Pixels @ 654,000 */ 0, 2,


..............
}


***** 2019-4-1 17:15:05

GUI_CONST_STORAGE GUI_BITMAP bmbackground={
  800, // xSize
  400, // ySize
  800, // BytesPerLine
  GUI_COMPRESS_RLE8, // BitsPerPixel
  _acbackground3,  // Pointer to picture data (indices)
  &_Palbackground3,  // Pointer to palette
  GUI_DRAW_RLE8
};

/*************************** End of file ****************************/



最佳答案

查看完整内容[请看2#楼]

我用BmpCvt软件打开PNG图片另存后选择True color with alpha, compressed后生成的c代码选择其中数组替换原来数组即可,其中Alpha channel,compressed是选择透明模式
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

4

主题

11

帖子

0

精华

初级会员

Rank: 2

积分
87
金钱
87
注册时间
2019-3-6
在线时间
21 小时
 楼主| 发表于 2019-4-1 17:17:24 | 显示全部楼层
我用BmpCvt软件打开PNG图片另存后选择True color with alpha, compressed后生成的c代码选择其中数组替换原来数组即可,其中Alpha channel,compressed是选择透明模式
回复

使用道具 举报

153

主题

310

帖子

0

精华

高级会员

Rank: 4

积分
673
金钱
673
注册时间
2019-3-26
在线时间
18 小时
发表于 2019-4-1 17:37:34 | 显示全部楼层
帮你顶帖问问吧
http://www.iis7.com/c/90/
回复

使用道具 举报

109

主题

5564

帖子

0

精华

资深版主

Rank: 8Rank: 8

积分
10572
金钱
10572
注册时间
2017-2-18
在线时间
1914 小时
发表于 2019-4-1 21:09:35 | 显示全部楼层
帮顶~~
回复

使用道具 举报

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

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-10 04:03

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表