CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

BITMAP

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ccmcca
Guest







BITMAP
PostPosted: Sat Nov 06, 2004 12:55 pm     Reply with quote

Anybody knows how can i do this?????
I have a 128 * 64 lcd and i want to show a bitmap.-
i declare a CONST string whith the hex locations but is not enought....
thanks.-
[/b]
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sat Nov 06, 2004 8:21 pm     Reply with quote

Well with the info you gave the only answer is to store the bitmap in flash and then display it.
Trampas



Joined: 04 Sep 2004
Posts: 89
Location: NC

View user's profile Send private message MSN Messenger

PostPosted: Sun Nov 07, 2004 7:16 am     Reply with quote

Yes, I am sure several of us know how to do it.

1) design board with some large external memory.
2) make and populate board
3) write drivers for LCD and memory
4) load external memory with bitmap
5) parse bitmap and display on LCD

Of course this does not answer you question, but we do not know what your question really is.

Here is a little joke:
A man in a ballon is lost and sees a guy walking down a road. He lowers the ballon and asks the guy, "Excuse me but could you tell me where I am?" The guy on the road looks up and says "Yes, you are in a ballon." The guy in the ballon, says "You must be an engineer."
"Why yes I am, how did you know."
"You gave me a technically correct answer that was no use to me."
After a brief pause the engineer looked at the guy in the ballon and said:
"You must be a manager." To which the guy in the ballon was surpised and said "Why, yes I am, how did you know?"
"Because you got yourself lost, and some how it has become my problem."

Trampas
ccmcca
Guest







BITMAP
PostPosted: Sun Nov 07, 2004 9:37 am     Reply with quote

#include <16F877.h>
#device *=16
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)

#include <HDM64GS12.c>
#include <graphics.c>

// " "
//CHAR const my_string[22]="hola amicomo vasssslr";
char const rawData[256]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same ideas to show the array?
Thanks again.





#ifdef FAST_GLCD
glcd_update();
#else
delay_ms(100); // Reduces flicker by allowing pixels to be on
// much longer than off
}
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sun Nov 07, 2004 3:48 pm     Reply with quote

I would suggest to read the data from ROM and write it to your display. Just as simple as that...

Somehow I guess that's not the answer you were waiting for, so please explain were your problem is. Is it in reading the data from ROM, or in the writing to your display?
Guest








BMP in external eeprom library
PostPosted: Mon Nov 08, 2004 6:58 am     Reply with quote

I store my bmp in an external i2c eeprom (24LC512), you can store 64 bmp. use an bmp to bin converter and prog the bin file in the eeprom

and i wrote a function for read each eeprom byte and write in the glcd.

Code:

///////////////////////////////////////////////////////////////////////////////
////                                                                       ////
////                           Transfert d'une image                       ////
////                    de 128 * 64 d'une eeprom vers le LCD               ////
////                                                                       ////
///////////////////////////////////////////////////////////////////////////////
////                                                                       ////
////    - Donnees : adresse de l'image dans l'eeprom                       ////
////                                                                       ////
///////////////////////////////////////////////////////////////////////////////

void glcd_image(int16 adresse)
{
   int8  *p1, *p2;
   int8 i, j;


   p1 = displayData.left;
   p2 = displayData.right;

   for(i=0; i<8; ++i)
   {
      for(j=0; j<128; ++j)
      {
       if (j<64)
               *p1++ = read_ext_eeprom(adresse++);
       else    *p2++ = read_ext_eeprom(adresse++);

      }
   }
}


in my code i call the function like this

Code:

{
...
#define INTRO 0x1000

glcd_image(INTRO);
glcd_update();
...
}


i wrote also an pseudo sprite function for display a little bmp like big font or animated bargraph...

Code:

///////////////////////////////////////////////////////////////////////////////
////                                                                       ////
////                           Transfert d'une image                       ////
////                    d'une eeprom vers le LCD                           ////
////                                                                       ////
///////////////////////////////////////////////////////////////////////////////
////                                                                       ////
////    - col : largeur en pixel de l'image                                ////
////    - lig : hauteur en ligne de l'image                                ////
////    - x : coordonnée horizontale ou afficher l'image (en pixel)        ////
////    - y : coordonnée verticale ou afficher l'image (en ligne)          ////
////    - adresse : adresse de l'image dans l'eeprom                       ////
////                                                                       ////
///////////////////////////////////////////////////////////////////////////////

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 = read_ext_eeprom(adresse++);
      }

   }
}


the call sequence is in this exemple

Code:

{
...
      adresse = LGE_FONT + (30 * (int16) digit[d]);
      glcd_sprite(15,2,x,y,adresse);
      glcd_update();
...
}


LGE_FONT is the start adress for my large font (15 pixel wide x 2 lines (16 pixel))
the LGE_FONT + (30 * (int16) digit) expression compute the offset of the digit

The limit of this second function is the Y position must be a line multiple and not real 0<y<64 coordinate. Maybe for the future...!!

In my eeprom, i store 10 bmp (0.bin + 1.bin + ... +9.bin), each digit (x.bin) is 30 byte long (15 pixel * 2 lines).

With this 2 functions, is very easy to make a beautiful (!) LCD interface.
you must use a 24xxx.c library, i modify the 24256.c to make a 24512 library... only the size of the memory.

I hope that help you.

My english is very approximate ! i'm living in Avignon - France. I read it much better than i wrote it !!
Thierry
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Mon Nov 08, 2004 9:34 am     Reply with quote

I did the same as above. (Guest)

A link that helped me is
http://www.8052.com/users/bahrio/fontgen.phtml

This program will slightly manipulate images. Also does fonts.

Nice little program.
action2003



Joined: 08 Nov 2004
Posts: 2
Location: Avignon - France

View user's profile Send private message Visit poster's website

PostPosted: Tue Nov 09, 2004 7:47 am     Reply with quote

what's a good link, i never write my function if i know it before Surprised

But, i'm a "C" beginner Embarassed , and i just translate my Proton basic pic sub-routine to CCS function.

I search scroll and roll sprite function for a GLCD.

Thierry as Guest Very Happy
_________________
Thierry - Avignon - France
Orcino



Joined: 07 Sep 2003
Posts: 56

View user's profile Send private message

PostPosted: Tue Mar 15, 2005 2:41 pm     Reply with quote

Hello, I am having problem Sad to execute the function placed for guest, somebody can help me with an example ?

Thanks

Orcino
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group