Connect with us

General question about storing graphics!

Discussion in 'Microcontrollers, Programming and IoT' started by 24Volts, Nov 5, 2010.

Scroll to continue with content
  1. 24Volts


    Mar 21, 2010

    I have a quick question about storing graphics in external flash memory. I have my own GL which is able to retrieve text, icons or pictures from an 8MEG flash and displays them on either a 1.5 " or 2.0" color LCD. Here's the thing though, when I am using the 1.5" LCD and I display a special icon it has to be a certain size. However if I display that same icon on the 2.0" LCD, it has to be slightly bigger. My question is, for us embedded guys that are using PICS with limited memory (comparing to today's memory in desktop computers) what are our options to do this.

    I was stuck in storing that same icon in two different sizes in flash. Another option would be to store it in flash as the biggest size and according to the size required we palletize the icon to reduce it to any size we require and redisplay it on the LCD.

    Is there such a utility or .c file that we can include in our code which resizes (or palletizes) graphics to a certain size so we can then display them.

    ALl feedback is very appreciated.
  2. saradalton


    Nov 8, 2010
  3. 24Volts


    Mar 21, 2010
    Hi saradalton,

    Yes, but what I am trying to say here, is that I need to be able to resize graphic (or fonts for that matter) at ****run time***** within the MCU. So it goes like this:

    The MCU loads a picture or a character font from flash. Then resizes it (Notice here... I need it resized without using a computer or the Internet) while the MCU is in run time. So then, I can redisplay it as the new size.

    I am just wondering if there exists a .c file that I can include in my C project programming and use it to do this resizing on the fly.

  4. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    Jan 21, 2010
    The simplest way is to display (say) every second pixel on every second row. This will display an image 1/4 sized.

    If you display each pixel twice, and duplicate each row then it will be 4x the size.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day