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 CCS Technical Support

Send image to LCD?

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



Joined: 02 Jul 2007
Posts: 9

View user's profile Send private message

Send image to LCD?
PostPosted: Sat Jan 26, 2008 8:25 am     Reply with quote

Hi, to send a image i use this in lcd driver:
(using the GCLCD TODOPIC generator)

Code:

void    Lcd_image(int x, int y, int16 * img)
{
   Int16   col, row, pWidth, pHeight;

   pWidth  =img[0];
   pHeight =img[1];

   for(row=0;row<pHeight;row++)
      {   
         for(col=0;col<pWidth;col++)
         {
            LCD_Pixel(col+x,row+y,img[col+row*pWidth+2]);
         }
      }   
}


And in the main program:

Quote:


int16 imagem[200] = {
0x10,0x20,
0x1234,0x3eff,0xffee,.................
};

Lcd_image(10, 10, &imagem[0]);



Work´s perfectly,

But, and if i want to do this:

For this type of image:

Quote:
STATIC CONST UNSIGNED INT16 face_cool [1026]={ image data};


How can i use the LCD_image() to send the image to LCD? since i can´t use &face_cool[0]

there is any tip or i have to change the way to send to LCD (void Lcd_image(int x, int y, int16 * img)


Thank´s on advance.

Note: And if i store the data on external eeprom?????
treitmey



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

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

PostPosted: Mon Jan 28, 2008 8:57 am     Reply with quote

Perhaps you could copy the const to ram first.
then you can use the pointers.
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Mon Jan 28, 2008 9:20 am     Reply with quote

The issue with images is that they take up space. Most images have pixels that are next to each other and that are the same. Look at run length encoding. With a PC preprocess the image and run length encode the image.A map in black and white will compress a great deal. With the PIC write code to unpack the image directly to the LCD in that way memory is conseved as well as eeprom space since a compressed image is stored.
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