Hallo Freunde! Gibt es eine Software (freeware) mit der ich ein Bild zeichen kann, und dieses anschliesend in C-code umwandeln lassen kann. Programmiere ein GLCD 128x64! Wenn jemand einen Link oder einen Tipp hat wäre super! Gruss Sarah
netpbm gestattet die Umwandlung vieler (pixel-orientierter) Grafikformate. Eins der möglichen Ausgabeformate ist dabei xbm (X11 bitmap format), das wiederum ist praktisch sofort benutzbarer C-Code. Ich habe mal auf die Schnelle das angehängte Bildchen gemalt und anschließend mit pngtopnm avr.png | ppmtopgm | pgmtopbm | pbmtoxbm > avr.xbm konvertiert. Hier ist der entstandene ,,C-Code'':
1 | #define noname_width 113
|
2 | #define noname_height 58
|
3 | static char noname_bits[] = { |
4 | |
5 | 0x00,0x00,0xff,0x03,0xff,0x03,0x00,0x00,0xff,0x83,0xff,0xff,0xff,0x00,0x00, |
6 | |
7 | 0x00,0x00,0xff,0x03,0xff,0x03,0x00,0x80,0xff,0x83,0xff,0xff,0xff,0x03,0x00, |
8 | |
9 | 0x00,0x00,0x03,0x07,0x07,0x03,0x00,0x80,0x81,0x81,0x01,0x00,0x00,0x0f,0x00, |
10 | |
11 | 0x00,0x80,0x03,0x06,0x06,0x07,0x00,0x80,0xc1,0xc1,0x01,0x00,0x00,0x1e,0x00, |
12 | |
13 | 0x00,0x80,0x01,0x06,0x06,0x06,0x00,0xc0,0xc1,0xc0,0x00,0x00,0x00,0x1c,0x00, |
14 | |
15 | 0x00,0x80,0x01,0x0e,0x0e,0x06,0x00,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x38,0x00, |
16 | |
17 | 0x00,0xc0,0x01,0x0c,0x0c,0x0e,0x00,0xe0,0xe0,0xe0,0x00,0x00,0x00,0x70,0x00, |
18 | |
19 | 0x00,0xc0,0x00,0x0c,0x0c,0x0c,0x00,0x60,0x60,0x60,0xe0,0xff,0x1f,0x60,0x00, |
20 | |
21 | 0x00,0xc0,0x00,0x1c,0x1c,0x0c,0x00,0x60,0x60,0x60,0xe0,0xff,0x3f,0xe0,0x00, |
22 | |
23 | 0x00,0xe0,0x60,0x18,0x18,0x1c,0x00,0x70,0x70,0x70,0x60,0x00,0x70,0xc0,0x00, |
24 | |
25 | 0x00,0x60,0x60,0x18,0x18,0x18,0x00,0x30,0x30,0x30,0x70,0x00,0xe0,0xc0,0x00, |
26 | |
27 | 0x00,0x60,0x60,0x38,0x38,0x18,0x00,0x30,0x38,0x30,0x30,0x00,0xc0,0xc0,0x01, |
28 | |
29 | 0x00,0x70,0xf0,0x30,0x30,0x38,0x00,0x38,0x18,0x38,0x30,0x00,0xc0,0x81,0x01, |
30 | |
31 | 0x00,0x30,0xf0,0x30,0x30,0x30,0x00,0x18,0x18,0x18,0x38,0x00,0x80,0x81,0x01, |
32 | |
33 | 0x00,0x30,0xf8,0x70,0x70,0x30,0x00,0x18,0x1c,0x18,0x18,0x00,0x80,0x81,0x01, |
34 | |
35 | 0x00,0x38,0xd8,0x60,0x60,0x70,0x00,0x1c,0x0c,0x1c,0x18,0x00,0x80,0x81,0x01, |
36 | |
37 | 0x00,0x18,0xd8,0x61,0x60,0x60,0x00,0x0c,0x0c,0x0c,0x1c,0x00,0xc0,0x81,0x01, |
38 | |
39 | 0x00,0x18,0x9c,0xe1,0xe0,0x60,0x00,0x0e,0x0e,0x0c,0x0c,0x00,0xc0,0xc0,0x01, |
40 | |
41 | 0x00,0x1c,0x8c,0xc1,0xc0,0x60,0x00,0x06,0x06,0x0e,0x0c,0x00,0xe0,0xc0,0x00, |
42 | |
43 | 0x00,0x0c,0x8c,0xc1,0xc0,0xe0,0x00,0x06,0x07,0x06,0x0e,0x00,0x70,0xe0,0x00, |
44 | |
45 | 0x00,0x0c,0x8e,0xc3,0xc1,0xc1,0x00,0x07,0x03,0x06,0x06,0x00,0x38,0x60,0x00, |
46 | |
47 | 0x00,0x0e,0x06,0x83,0x81,0xc1,0x00,0x03,0x03,0x07,0xfe,0xff,0x1f,0x70,0x00, |
48 | |
49 | 0x00,0x06,0x06,0x83,0x81,0xc1,0x01,0x83,0x03,0x03,0xfc,0xff,0x07,0x38,0x00, |
50 | |
51 | 0x00,0x06,0x07,0x87,0x83,0x83,0x81,0x83,0x01,0x03,0x00,0x00,0x00,0x38,0x00, |
52 | |
53 | 0x00,0x07,0x03,0x06,0x03,0x83,0x81,0x81,0x81,0x03,0x00,0x00,0x00,0x1e,0x00, |
54 | |
55 | 0x00,0x83,0x03,0x06,0x03,0x83,0x83,0xc1,0x81,0x01,0x00,0x00,0x00,0x0f,0x00, |
56 | |
57 | 0x00,0x83,0x01,0x06,0x07,0x07,0xc3,0xc1,0x80,0x01,0x00,0x00,0xe0,0x03,0x00, |
58 | |
59 | 0x80,0x83,0xff,0x0f,0x06,0x06,0xc3,0xe0,0xc0,0x81,0xff,0x07,0xfe,0x01,0x00, |
60 | |
61 | 0x80,0xc1,0xff,0x0f,0x06,0x06,0xe7,0x60,0xc0,0x80,0xff,0x07,0x3e,0x00,0x00, |
62 | |
63 | 0x80,0x01,0x00,0x00,0x0e,0x0e,0x66,0x60,0xc0,0x80,0x01,0x0e,0x0e,0x00,0x00, |
64 | |
65 | 0xc0,0x01,0x00,0x00,0x0c,0x0c,0x66,0x70,0xe0,0xc0,0x01,0x1c,0x1c,0x00,0x00, |
66 | |
67 | 0xc0,0x00,0x00,0x00,0x0c,0x1c,0x7e,0x30,0x60,0xc0,0x00,0x18,0x18,0x00,0x00, |
68 | |
69 | 0xc0,0x00,0x00,0x00,0x1c,0x18,0x3c,0x30,0x60,0xe0,0x00,0x38,0x38,0x00,0x00, |
70 | |
71 | 0xe0,0x00,0x00,0x00,0x18,0x18,0x3c,0x38,0x70,0x60,0x00,0x70,0x70,0x00,0x00, |
72 | |
73 | 0x60,0x00,0x00,0x00,0x18,0x38,0x3c,0x18,0x30,0x60,0x00,0x60,0x60,0x00,0x00, |
74 | |
75 | 0x60,0xe0,0xff,0x7f,0x38,0x30,0x18,0x18,0x30,0x70,0x00,0xe0,0xe0,0x00,0x00, |
76 | |
77 | 0x70,0xe0,0xff,0x7f,0x30,0x30,0x18,0x1c,0x38,0x30,0x00,0xc0,0xc1,0x01,0x00, |
78 | |
79 | 0x30,0x70,0x00,0x60,0x30,0x70,0x18,0x0c,0x18,0x38,0x00,0x80,0x83,0x01,0x00, |
80 | |
81 | 0x30,0x30,0x00,0xe0,0x70,0x60,0x00,0x0e,0x18,0x18,0x00,0x80,0x83,0x03,0x00, |
82 | |
83 | 0x38,0x30,0x00,0xc0,0x60,0x60,0x00,0x06,0x1c,0x18,0x00,0x00,0x07,0x07,0x00, |
84 | |
85 | 0x18,0x38,0x00,0xc0,0x60,0xe0,0x00,0x06,0x0c,0x1c,0x00,0x00,0x0e,0x0e,0x00, |
86 | |
87 | 0x18,0x18,0x00,0xc0,0xe0,0xc0,0x00,0x07,0x0c,0x0c,0x00,0x00,0x0c,0x0e,0x00, |
88 | |
89 | 0x1c,0x1c,0x00,0xc0,0xc1,0xc0,0x00,0x03,0x0e,0x0c,0x00,0x00,0x1c,0x1c,0x00, |
90 | |
91 | 0x0c,0x0c,0x00,0x80,0xc1,0xc0,0x01,0x03,0x06,0x0e,0x00,0x00,0x38,0x38,0x00, |
92 | |
93 | 0x0c,0x0c,0x00,0x80,0xc1,0x81,0x81,0x03,0x06,0x06,0x00,0x00,0x30,0x30,0x00, |
94 | |
95 | 0x0e,0x0e,0x00,0x80,0x81,0x81,0x81,0x01,0x07,0x07,0x00,0x00,0x70,0x70,0x00, |
96 | |
97 | 0x06,0x06,0x00,0x80,0x83,0x81,0xc3,0x01,0x03,0x03,0x00,0x00,0xe0,0xe0,0x00, |
98 | |
99 | 0x06,0x06,0x00,0x00,0x83,0x03,0xc3,0x00,0x03,0x03,0x00,0x00,0xc0,0xc0,0x00, |
100 | |
101 | 0xff,0x07,0x00,0x00,0xff,0x03,0xc3,0x00,0xff,0x03,0x00,0x00,0xc0,0xff,0x01, |
102 | |
103 | 0xff,0x03,0x00,0x00,0xff,0x03,0xe7,0x00,0xff,0x01,0x00,0x00,0x80,0xff,0x01, |
104 | |
105 | 0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
106 | |
107 | 0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
108 | |
109 | 0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
110 | |
111 | 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
112 | |
113 | 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
114 | |
115 | 0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
116 | |
117 | 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
118 | |
119 | 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; |
#! /bin/sh if [ $# -ne 1] ; then echo "Usage: bmp2c <filename>" >&2 exit 1 fi oname=${1%.*}.c bmptopnm $1 | pnmtopgm | pgmtopbm | pbmtoxbm > ${oname} ## EOF SCNR :-)
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.