0

我需要在 gui“dosbox_splash.h”中自定义徽标图像 dosbox,但格式为 .h

像这样 - -

static const struct {
  unsigned int   width;
  unsigned int   height;
  unsigned int   bytes_per_pixel; /* 3:RGB, 4:RGBA */
  unsigned char  rle_pixel_data[24875 + 1];
} gimp_image = {
  640, 400, 3,
  "\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272"
  "=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377"
  "\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0"
  "\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272"
  "=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377"
  "\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0"
  "\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272"
  "=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377"
  "\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0"
  "\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272"
  "=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377"
  "\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0"
  "\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272"
  "=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377"
  "\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0"
  "\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272"
  "=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377"
  "\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0"
  "\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272"
  "=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377\272=\0\377"

我在 Windows 上使用 gimp 并且没有创建相同的格式,编译时出现错误初始化字符串 for chars is too long

我的格式

static const struct {
  unsigned int   width;
  unsigned int   height;
  unsigned int   bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */ 
  unsigned char  pixel_data[640 * 400 * 3 + 1];
} gimp_image = {
  640, 400, 3,
  "\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\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\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\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\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\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\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\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
  "\1\1\1\1\1\1\1\1\1\1\1\3\1\4\2\0\3\2\2\4\0\0\4\1\4\11\34!%\341\346\352\365"
  "\375\377\367\377\377\357\364\367\373\377\377\367\371\370\377\376\374\377"
  "\374\371\377\373\367\374\367\363\245\240\234#\40\33\5\1\0\1\0\0\5\3\4\0\0"
  "\2\10\10\12\3\4\10\1\2\6\1\2\6\1\2\6\0\1\3\1\1\1\1\1\1\1\1\0\2\1\0\2\0\3"
4

2 回答 2

0

使用 Gimp 时,您可能希望将图像导出为“C 源代码”。然后您会看到一个选项对话框,您可以在其中检查“使用 1 字节运行长度编码”(这也是 rle_pixel_data 中的数据编码的内容)。使用“C 源代码标头”导出器不会为您提供该选项,从而导致更大的图像数据字符串。

于 2013-08-28T13:55:58.953 回答
0

或看看http://forum.xda-developers.com/showthread.php?t=1140406它看起来像是将工具从图像转换为rle ...

于 2013-08-28T14:01:39.377 回答