element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
STM32F4DISCOVERY Expansion Boards
  • Products
  • Dev Tools
  • STM32F4DISCOVERY Expansion Boards
  • More
  • Cancel
STM32F4DISCOVERY Expansion Boards
Forum Stm32f4 loading image
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join STM32F4DISCOVERY Expansion Boards to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 18 replies
  • Subscribers 8 subscribers
  • Views 3332 views
  • Users 0 members are here
Related

Stm32f4 loading image

philip-1992
philip-1992 over 12 years ago

Hi all,

 

I am still on the experimenting phase of the stm32f4 Discovery. I am trying to load an image on the touch screen (DM-LCD35RT) but I cannot find any examples in order to guide me. Is there anyone that has an available example in which I can understand the process and thus write my own program? Any help would be greatly appreciated. Thank you

  • Sign in to reply
  • Cancel
Parents
  • Kilohercas
    0 Kilohercas over 12 years ago

    All you have to do, is to write windowfunction for lcd, and you can edit LCD_CLear function to paint picture. I could do that, but i don't have right LCD

    void LCD_SetDisplayWindow(uint8_t Xpos, uint16_t Ypos, uint8_t Height, uint16_t Width)

    {

      if(Xpos >= Height)

      {

        LCD_WriteReg(0x0044, (Xpos - Height +1));

      }

      else

      {

        LCD_WriteReg(0x0044, 0x0000);

      }

      if(Ypos >= Width)

      {

        LCD_WriteReg(0x0045, (Ypos - Width +1));

      } 

      else

      {

        LCD_WriteReg(0x0045, 0x0000);

      }

      LCD_WriteReg(0x0046, Ypos);

      LCD_SetCursor(Xpos, Ypos);

     

    }

     

    And with internal flash, it is possibe to save up to 7 pictures at 320x240 resolution

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • philip-1992
    0 philip-1992 over 12 years ago in reply to Kilohercas

    Yes but I still have the 32K size limit of IAR that is the problem. Hopefully by storing the pictures on the SD card it will not exceed the 32K

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Kilohercas
    0 Kilohercas over 12 years ago in reply to philip-1992

    no, because you could use 50x50 pictures, not 320x240.
    so you can still develope code under size limit, or go for another trial of compiler, but time, not size limited

     

    Ok, writed simple program, to paint using paint pixel function (you must use paint pixel function with x, y, and colour parameters to make it work, i don't know ST library function name for that)

     

     

    void Slow_paint(int x_start,int y_start,int size_x, int size_y,uint8_t *bitmap)

    {

      uint16_t *bitmap_ptr = (uint16_t *)bitmap;

      int i=0,j=0;

      while(i<size_y)

      {

        while(j<size_x)

        {

         Pixel(j+x_start,i+y_start,*bitmap_ptr++);

          j++;

        }

        i++;

        j=0;

      }

    }

     

    call it like this:
    Slow_paint(10,10,60,60,(u8*)ImageBuffer);

    10 is offset, and 60x60 is my picture size, change to mach your own

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Kilohercas
    0 Kilohercas over 12 years ago in reply to philip-1992

    no, because you could use 50x50 pictures, not 320x240.
    so you can still develope code under size limit, or go for another trial of compiler, but time, not size limited

     

    Ok, writed simple program, to paint using paint pixel function (you must use paint pixel function with x, y, and colour parameters to make it work, i don't know ST library function name for that)

     

     

    void Slow_paint(int x_start,int y_start,int size_x, int size_y,uint8_t *bitmap)

    {

      uint16_t *bitmap_ptr = (uint16_t *)bitmap;

      int i=0,j=0;

      while(i<size_y)

      {

        while(j<size_x)

        {

         Pixel(j+x_start,i+y_start,*bitmap_ptr++);

          j++;

        }

        i++;

        j=0;

      }

    }

     

    call it like this:
    Slow_paint(10,10,60,60,(u8*)ImageBuffer);

    10 is offset, and 60x60 is my picture size, change to mach your own

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube