پاسخ : سوالات مربوط به LCD های کاراکتری و گرافیکی
سلام ، نحوه اتصال دوربین به میکرو با ال سی دی رنگی
سلام ، نحوه اتصال دوربین به میکرو با ال سی دی رنگی
//------------------------ void N11_DrawBitmap(_const unsigned char *bitmap, unsigned char x, unsigned char y, N11_Pmode mode) { unsigned char header, width, height; unsigned char xx, yy, rr; unsigned int xy; unsigned char pd, pc, ps; unsigned char Cdata; header = _pgm_read_byte(bitmap[0]); //header size & width & height width = _pgm_read_byte(bitmap[1]); height = _pgm_read_byte(bitmap[2]); ps = _ror(1 << (y%8)); for(xx=0; xx<width; xx++) { pd = ps; Cdata = _pgm_read_byte(bitmap[xx+header]); for(yy=0, pc=0; yy<height; yy++,pc++) { if(pc==8) { xy = (unsigned char)(yy/8)*width + xx+header; Cdata = _pgm_read_byte(bitmap[xy]); pc = 0; }//if pc rr = (unsigned char)((y+yy)/8); pd = _rol(pd); //Draw BMP! if(mode == PIXEL_XOR) { if(bit_is_set(Cdata, pc)) N11_Cache[x+xx][rr] &= ~pd; else N11_Cache[x+xx][rr] |= pd; } else { if(bit_is_set(Cdata, pc)) N11_Cache[x+xx][rr] |= pd; else N11_Cache[x+xx][rr] &= ~pd; } }//for yy }//for xx N11_Update(); } //*N11_DrawBitmap
//------------------------------------------------- //--- Loads a Bitmap to GLCD ---// void KS108_DrawBitmap(_const unsigned char *bitmap, unsigned char x, unsigned char y, Show_Mode mode) { unsigned char width, height, header; unsigned char displayData; unsigned char xx, yy, yyy; unsigned char hh, ww; unsigned char endShift; unsigned int xy; header = _pgm_read_byte(bitmap[0]); width = _pgm_read_byte(bitmap[1]); height = _pgm_read_byte(bitmap[2]); // Drawing position calculation ww = width; hh = height; if((x+ww) > DISPLAY_WIDTH) ww = DISPLAY_WIDTH -x; if((y+hh) > DISPLAY_HEIGHT) hh = DISPLAY_HEIGHT -y; if(hh%8) hh = hh/8+1; else hh = hh/8; endShift = 0; // Draw my BMP! if(mode != TRANS) KS108_FillRect(x, y, width-1, height-1, WHITE); //no transparent for(yy=0; yy<hh; yy++) { yyy = y + (yy * 8); if(yyy > (DISPLAY_HEIGHT-8)) { endShift = y % 8; yyy = DISPLAY_HEIGHT -8; } KS108_GotoXY(x, yyy); xy = (unsigned int)(yy)*width +header; for(xx=0; xx<ww; xx++) { displayData = _pgm_read_byte(bitmap[xy++]); if(endShift) KS108_WriteData((displayData << endShift)|KS108_ReadData()); else KS108_WriteData(displayData); } } if(mode == INVERS) KS108_InvertRect(x, y, width-1, height-1); //invers color } //KS108_DrawBitmap
دیدگاه