View previous topic :: View next topic |
Author |
Message |
chalukg
Joined: 12 Dec 2010 Posts: 6 Location: Turkey
|
GLCD Problem. |
Posted: Fri Feb 11, 2011 5:06 pm |
|
|
Hello dear coders. I have a problem as you read.
I wrote something on GLCD and when I want to rewrite on the same pixel
it overwrites on it. So that I have to clear screen and have to rewrite what I want to write. Is there any solutions for this situation or do I have to keep doing this?
I hope i could explain myself. |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Sat Feb 12, 2011 9:43 am |
|
|
Hi,
The answer to your question is fundamentally 'yes'. The graphic lcd is nothing more than an array of pixels that you control Off/On. When you overwrite an area on the GLCD with new data, it is imperative that all pixels within that area be 'refreshed' to the new value, if the value for a particular pixel has changed. If you are writing text to the GLCD, all of the pixels associated with displaying a particular character are defined, so you don't have to explicitly refresh an area when updating. That is the way that the glcd_text57 function works in GLCD.c. If I was writing a routine to display a bitmap image or something, I would write it so that each pixel is explicitly controlled.
Hope that helps! If not, maybe you could be more specific about your problem and/or post the problem code!
John |
|
|
petu65
Joined: 05 Jan 2011 Posts: 8
|
|
Posted: Fri Feb 18, 2011 6:41 am |
|
|
Modify GLCD.C like this:
Look at "void glcd_text57(int x,....." section almost end of code.
Code: |
if(bit_test(pixelData[j], k)) // Check if the pixel should be set
{
for(l=0; l<size; ++l) // The next two loops change the
{ // character's size
for(m=0; m<size; ++m)
{
glcd_pixel(x+m, y+k*size+l, color); // Draws the pixel
}
}
}
else
{
for(l=0; l<size; ++l) // The next two loops change the
{ // character's size
for(m=0; m<size; ++m)
{
glcd_pixel(x+m, y+k*size+l, OFF); // Draws the pixel
}
}
}
}
}
}
}
|
This overwrite all pixels, used and not used ones. |
|
|
|