Gast
#4480055
Hallo Freunde,
könnt ihr mir sagen, wieso ich folgendes verzerrtes Bild (siehe Anhang)
unter dem Bitmap erhalte bzw. hatte jemand schonmal so ein Problem
Der Code für das Zeichnen eines Bitmaps sieht wie folgt aus:
void UTFT::drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data,
int scale)
{
unsigned int col;
int tx, ty, tc, tsx, tsy;
byte r, g, b;
if (scale==1)
{
setXY(x, y, x+sx-1, y+sy-1);
for (tc=0; tc<(sx*sy); tc++)
{
col=pgm_read_word(&data[tc]);
LCD_Write_DATA(col>>8,col & 0xff);
}
}
else
{
for (ty=0; ty<sy; ty++)
{
setXY(x, y+(ty*scale), x+((sx*scale)-1), y+(ty*scale)+scale);
for (tsy=0; tsy<scale; tsy++)
for (tx=0; tx<sx; tx++)
{
col=pgm_read_word(&data[(ty*sx)+tx]);
for (tsx=0; tsx<scale; tsx++)
LCD_Write_DATA(col>>8,col & 0xff);
}
}
}
clrXY();
}
