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 3335 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

    First download Embedded Resource Editor GUI from www.st.com, it will allow you to convert BMP, jpg and other to char array, and it will generate code.image

     

    Next you have to have paint bmp function, (you must know converted picture dimensions, like 320x240,  (you must resize jpg or any other file so it can fit inside screen !!!!)
    After that, copy generated file to bmp.h, include that to main.c, and call paint function from LCD library

    as example, i have SSD1289 with void LCD_WriteBMP(uint8_t Xpos, uint16_t Ypos, uint8_t Height, uint16_t Width, uint8_t *bitmap) function
    so in main.c, i call:

    LCD_WriteBMP(0,0,320,240,(u8) * Name_of_Char_array_generated_by_gui_aka_ImageBuffer);

     

    Questions ?

    (mark helpful or correct answer if it helped)

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

    My screen is SSD2119 so does this line: void LCD_WriteBMP(uint8_t Xpos, uint16_t Ypos, uint8_t Height, uint16_t Width, uint8_t *bitmap)  still works? Or that is from a ready made h file? Also:Name_of_Char_array_generated_by_gui_aka_ImageBuffer does that mean the file name generated by that program?

    • 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

    Yes, it should work.
    in GUI it will create array called const unsigned char ImageBuffer[], you can use default, or rename to mach your picture name.

    1) Copy all code generated by program to file picture.h

    2) #include <picture.h>  inside your main.c file

    3) Make sure you init your screen, so it can display something, test it with LCD_Clear(0xFF00);

    4) paint picture by calling : LCD_WriteBMP(0, 0, X, Y, (uint8_t*) ImageBuffer); // note that X and Y must be same, or lower than resollution of your screen, so max_x is 320, max_y 240 if i remember resolution corecly , test first with 200x200 pixels picture, so crop it, resize it, convert it to char array and so on.

    5) enjoy

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

    I will try this hopefully by today will get back to you with the results image Thanks for your time

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

    I will try this hopefully by today will get back to you with the results image Thanks for your time

    • 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