Markdem
Joined: 24 Jun 2005 Posts: 206
|
GLCD and Graphics |
Posted: Thu Sep 15, 2011 9:36 pm |
|
|
Hi everyone,
I need to be able to draw icons on a glcd (KS0108) screen that are 11 x 11 pixels. I can draw icons fine is they are in multiples of 8, but I simply can't get my head around odd sizes.
I have tried the following code found here http://www.ccsinfo.com/forum/viewtopic.php?t=20912&highlight=bitmap
Code: |
void glcd_sprite(int8 col, lig , x , y , int16 adresse)
{
int8 *p;
int8 i, j, data;
int16 temp;
for(i=0; i<lig; ++i)
{
temp = y + i;
temp *= 64;
temp += x;
for(j=0; j<col; ++j)
{
p = temp + j;
if(x + j > 63)
{
p += displayData.right - 64;
}
else
{
p += displayData.left;
}
*p = image[i++];
}
}
}
|
Problem with that code is it will not allow me to position the image where ever I want on the y axis.
I guess my question is, has anyone got a function to display oddball image sized images on a GLCD??
Thanks
Mark |
|