element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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
Connected Cloud Challenge
  • Challenges & Projects
  • Design Challenges
  • Connected Cloud Challenge
  • More
  • Cancel
Connected Cloud Challenge
Blog Connected Cloud Challenge - IoT based Advertisement BillBoards/Hordings - #BlogPost-7
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: sami9974
  • Date Created: 10 May 2020 5:52 PM Date Created
  • Views 415 views
  • Likes 2 likes
  • Comments 0 comments
  • connectedcloud
  • connected cloud
  • tft
  • psoc6
  • emwin
  • aws_iot
  • cypress
Related
Recommended

Connected Cloud Challenge - IoT based Advertisement BillBoards/Hordings - #BlogPost-7

sami9974
sami9974
10 May 2020

TFT Display Bitmap Custom Image:

 

As we have seen in the previous blog we can modify or create our own code to display custom images on TFT screen of PSoC 6.

Let's get started with code that needs to be modified.

 

First, start with main_cm4.c file :

 

void ShowBitmap(void)
{
    /* Set background color to black and clear screen */
    GUI_SetBkColor(GUI_BLACK);
    GUI_Clear();


    /* Display the bitmap image on the screen */
    GUI_DrawBitmap(&bmdefault, 0, 4); // here you need to define the name of the image (bmdefault)


    /* Set font size, font color to black */
    GUI_SetFont(GUI_FONT_16B_1);
    GUI_SetColor(GUI_BLACK);


    /* Set text mode to transparent, underlined and center aligned */
    GUI_SetTextMode(GUI_TM_TRANS);
    GUI_SetTextAlign(GUI_TA_HCENTER);
    GUI_SetTextStyle(GUI_TS_UNDERLINE);


    /* Print the page title text */
    //GUI_DispStringAt("Bitmap Display Text", 160, 10);
}

 

But still, we have not defined this image reference --> here directly we have used it in code.

 

The reference that needs to be defined in bitmaps.h

#ifndef __BITMAPS_H
#define __BITMAPS_H


#include <project.h>
#include "GUI.h"


/* Reference to bitmap images */
extern GUI_CONST_STORAGE GUI_BITMAP bmdefault;  //need to define image name same as with you added into Resource file
extern GUI_CONST_STORAGE GUI_BITMAP bmKS1241172;  
extern GUI_CONST_STORAGE GUI_BITMAP bmCypressLogoFullColor_PNG_316pixels;


#endif /* __BITMAPS_H */


/* [] END OF FILE */

 

Till now we have defined Image and used that image into code.

 

Ques:

How image will be stored into PSoC 6 memory and how it will be displayed on TFT screen.

 

For that, we need to convert our image into 320*213 scale (X-axis* Y-axis)

Then need to convert that image into Bitmap for EmWin library compatible so that the controller/system can process it and display it into TFT screen using this EmWin library. You read more about the library from this link.

 

Here is an image that I have created to display. Which I have defined as "default" in the code sample.

image

After converting this image into BitMap format (default.c) need to place this file into Source Files >> Images >> Paste here your file.

 

And we have done with the changes. Now you can follow basic steps to upload this code into Board. (Debug >> Program).

 

Result:

image

image

 

Related Link:

LCD BitMap converter for EmWin

(https://www.segger.com/products/user-interface/emwin/tools/tools-overview/)

(Download LCD Bitmap Converter for emWin by Pixfonter, Free to try. )

Attachments:
default.c.zip
  • Sign in to reply
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