#1 [25.05.10, 21:49] No putchar ? No problem :D [DB3210]
Hi, I tried to find a way how to draw images on screen without putchar. And I found it
I didn't want to improve algorithm (maybe no time, maybe I'm not so good programmer), so image must be: +reversed in vertical +reversed in horizontal. It caused by .bmp file format. Colors are written from bottom to top.
So image must be like this:
Bmp header length is 0x36.
So I'm starting to read data after the header and I'm writting them in an array.
int MyGuiOnCreate(DISP_OBJ *db) { gc = get_DisplayGC(); int f = fopen (L"/card/other/Ex1.bmp",WA_Read,0x180); int filesize = fsize (f); fseek (f,fpos,0); int bmppos = 0; while (fpos < filesize-10) { int b = _fgetc (f); int g = _fgetc (f); int r = _fgetc (f); int color = 0xFF000000 + r * 0x10000 + g * 0x100 + b; bmp[bmppos] = color; bmppos++; //debug_printf ("\n --->>>>color: #%X \n",color); } //redr_timer=Timer_Set(10,onRedrTimer,0); return 1; }
It takes some second to write every color into an array. I hope it will be useful for elf developers.
This idea is my own idea, maybe it's stupid. But it can surely be improved (I think it won't be a problem to set 0xFF000000 as alpha-channel). I tested this on some bitmaps, saved in 24bit :)
Вы не можете начинать темы. Вы не можете редактировать свои сообщения. Вы не можете создавать опросы. Вы не можете вкладывать файлы в сообщения. Вы не можете отвечать на сообщения. Вы не можете удалять свои сообщения. Вы не можете голосовать.