Skocz do zawartości

Zablokowane Zapis obrazka podanego w postaci kodu


Marmot

Rekomendowane odpowiedzi

No więc tak. Wiem, że trochę się dziwnie zachowuję, no ale dobra. Więc w GIMPie zapisuję sobie obrazek z roszerzeniem *.h . Mam wtedy taki kod:

/*  GIMP header image file format (RGB): C:\obrazek.h  */

static unsigned int width = 50;
static unsigned int height = 50;

/*  Call this macro repeatedly.  After each use, the pixel data can be extracted  */

#define HEADER_PIXEL(data,pixel) {\
 pixel[0] = (((data[0] - 33) << 2) | ((data[1] - 33) >> 4)); \
 pixel[1] = ((((data[1] - 33) & 0xF) << 4) | ((data[2] - 33) >> 2)); \
 pixel[2] = ((((data[2] - 33) & 0x3) << 6) | ((data[3] - 33))); \
 data += 4; \
}
static char *header_data =
    "````````````````````````````````````````````````````````````````"
    "````````````````````````````````````````````````````````````````"
    "````````````````````````````````````````````````````````````````"
    "````````````````````````````````_`P\\XN\\?KKKKCIK+AI+#F*35P,S]\\O\\O"
    "````````````````````````````````````````````````````````````````"
    "````````````````````````````````````````````````````````````````"
    "````````````````````````````````````]P,SM,#Q56&2)3%B\"Q=(!A)##AI+"
    "(R]@3EJ+IK+C\\O\\O````````````````````````````````````````````````"
    "````````````````````````````````````````````````````````````````"
    "````````````````````````````````````````]P,SI[/D)3%B!!!!!!!!!!!!"
    "!!!!!!!!!!!!!1%\"$AY/3EJ+M<'R^04U````````````````````````````````"
    "````````````````````````````````````````````````````````````````"
    "````````````````````````````````````````````_`P\\M,#Q)3%B!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1%\"%B)38&R=O\\O\\^04U````````````````"
    "````````````````````````````````````````````````````````````````"
    "````````````````````````````````````````````````````XN\\?56&2!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\"!1%-4%RG*C9[?HJ````"
    "````````````````````````````````````````````````````````````````"
    "````````````````````````````````````````````````````````````KKKK"
    "(\"Q=!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'RM<"
    "G*C9^04U````````````````````````````````````````````````````````"
    "````````````````````````````````````````````````````````````````"
    "````@X^`!Q-$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!-4%RO\\O\\````````````````````````````````````````````````"
    "````````````````````````````````````````````````````````````````"
    "````````````7FJ;!1%\"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!\"15&9W.D^04U````````````````````````````````````"
    "````````````````````````````````````````````````````````````````"
    "````````````````````45V.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!*#1ET=X.````````````````````````````"
    "````````````````````````````````````````````````````````````````"
    "````````````````````````````256&!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1%\"(2U>=X.TKKKKXN\\?_`P\\````"
    "````````````````````````````````````````````````````````````````"
    "````````````````````````````````````3EJ+!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!(\"Q=8V^@"
    "P\\_`^P<W````````````````````````````````````````````````\\O\\OL[_P"
    ":'2E04U^04U^:'2EL[_P\\O\\O````````````````````35F*!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!,CYOPL[__`P\\````````````````````````````````````````X.T="
    ";'BI%R-4!Q-$!!!!!!!!!Q-$%R-4;'BIX.T=````````````````3UN,!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!.T=XS]P,````````````````````````````````````"
    "\\O\\O;GJK\"15&!!!!!!!!!!!!!!!!!!!!!!!!\"15&;GJK\\O\\O````````````3%B)"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Q-$<'RM\\O\\O````````````````````````"
    "````````L;WN&B97!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&R=8L;WN````````"
    "````3%B)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!+SMLP,S]````````````````"
    "````````````````8&R=!1%\"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!A)#9W.D"
    "````````````3%B)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\"Q=(CIK+````````"
    "````````````````````^`@X*35F!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!/DI[````````````3%B)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!56&2"
    "````````````````````````````T=X.\"Q=(!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!+3EJ````````````4%R-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!Q-$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!(2U>Y/$A````````````````````^04U>86V!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!+#AI````````````3%B)!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!)S-D'\"A9\"A9'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!A)#=(\"Q_0DY````````````````NL;W'BI;!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!-T-T````````````3EJ+!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!3%B)S=H*>86V.T=X#1E*!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!%B)3QM,#````````````Z/4E1E*#!1%\"!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!4%R-````````````256&!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!256&````````````J[?H$Q]0!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!A)#6&25_`P\\````T=X.+CIK!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1%\"<'RM````````````3EJ+"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3EJ+````````````XN\\?-D)S"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%\"!1QM,#BY?(!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\"A9'G*C9````````"
    "````35F*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!35F*````````````"
    "_`P\\@X^`#1E*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1%\"-$!Q!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&\"15T=X."
    "````````````3UN,!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3UN,````"
    "````````````VN<70T]`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!1%\"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    ",3UN^04U````````````3%B)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "3%B)````````````````_`P\\K+CI$!Q-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!15&\"````````````````3%B)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!3%B)````````````````````\\_`P6666!1%\"!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!3%B)````````````````3%B)!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!3%B)````````````````````````LK[O$!Q-!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!3UN,````````````````3%B)!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!3%B)````````````````````````\\O\\O+CIK!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!35F*````````````````4%R-!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!4%R-````````````````````````````"
    "7FJ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3EJ+````````````````3%B)"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3%B)````````````````````"
    "````````DI[/\"A9'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!256&````````````"
    "````3EJ+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3EJ+````````````"
    "````````````````P,S](2U>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3EJ+````"
    "````````````256&!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!256&````"
    "````````````````````````\\O\\O4U^0!A)#!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "3%B)````````````````3EJ+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "3EJ+````````````````````````````````M<'R)S-D!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!#QM,!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!4%R-````````````````35F*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!35F*````````````````````````````````^04UF*35&R=8!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!4EZ/1%\"!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!3%B)````````````````4EZ/!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!35F*````````````````````````````````````[?HJG*C9"
    "-4%R\"15&!!!!!!!!!!!!!!!!!!!!!!!!%\"!1B)3%^04U3%B)!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!3%B)````````````````5F*3!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!+SML^04U````````````````````````````````"
    "````^04UO\\O\\9W.D+3EJ%\"!1\"!1%\"15&(BY?4EZ/HZ_@[?HJ````3%B)!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3%B)````````````````9W.D!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\"A9'F*35[?HJ````````````````````"
    "````````````````````^04UT=X.HZ_@BI;'BI;'HZ_@T=X.^04U````````3%B)"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3%B)````````````````@X^`"
    "!1%\"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!(2U>HZ_@^04U````````"
    "````````````````````````````````````````````````````````````````"
    "````3UN,!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3UN,````````````"
    "````JK;G!Q-$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!4EZ/T=X."
    "````````````````````````````````````````````````````````````````"
    "````````````35F*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!35F*````"
    "````````````U.$1'BI;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "(R]@HZ_@````````````````````````````````````````````````````````"
    "````````````````````3EJ+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "3EJ+````````````````[_PL8&R=!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!\"Q=(BI;'````````````````````````````````````````````````"
    "````````````````````````````256&!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!256&````````````````_`P\\LK[O$!Q-!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!\"Q=(BI;'````````````````````````````````````````"
    "````````````````````````````````````3EJ+!!!!!!!!!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!3EJ+````````````````````Y_0D8FZ?!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!(R]@HZ_@````````````````````````````````"
    "````````````````````````````````````````````3%B)!!!!!!!!!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!3%B)````````````````````_`P\\S=H*,S]P!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!4EZ/T=X.````````````````````````"
    "````````````````````````````````````````````````````4U^0!!!!!!!!"
    "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!4U^0````````````````````````^P<W"
    "N\\?X/TM\\\"Q=(!!!!!!!!!!!!!!!!!!!!!!!!+CIKHZ_@^04U````````````````"
    "````````````````````````````````````````````````````````````76F:"
    "!1%\"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1%\"76F:````````````````````"
    "````````_`P\\S]P,;GJK+CIK%\"!1\"!1%\"15&(2U>4EZ/HZ_@[?HJ````````````"
    "````````````````````````````````````````````````````````````````"
    "````>86V!Q-$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Q-$>86V````````````"
    "````````````````````````^04UT=X.HZ_@BI;'BI;'HZ_@T=X.^04U````````"
    "````````````````````````````````````````````````````````````````"
    "````````````H:W>&R=8!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&R=8H:W>````"
    "````````````````````````````````````````````````````````````````"
    "````````````````````````````````````````````````````````````````"
    "````````````````````T=X.3UN,!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3UN,"
    "T=X.````````````````````````````````````````````````````````````"
    "````````````````````````````````````````````````````````````````"
    "````````````````````````````^04UHZ_@+3EJ!!!!!!!!!!!!!!!!!!!!!!!!"
    "+3EJHZ_@^04U````";

Chciałbym teraz, żeby zapisywał mi ten obrazek który jest w tym kodzie, jako plik bmp. Chodzi tutaj o pewien plan którego szczegółów nie chcę zdradzać (powiem tylko że chodzi tu o drobne zabezpieczenia B) ).

Pomocy!

Odnośnik do komentarza
Udostępnij na innych stronach

Ale to tylko porównanie. Mi chodziło o to, żeby ten kod zapisał ten obrazek który jest w nim w postaci kodu. Chodzi tu o coś takiego, że:

-> Odpalam plik obrazek.exe utworzony z tego obrazek.h

-> Plik obrazek.exe tworzy plik obrazek.bmp bez wyświetlania tego obrazka

-> Mam plik *.bmp który utworzył ten kod.

Odnośnik do komentarza
Udostępnij na innych stronach

  • 2 miesiące temu...
Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...