How to reduce the code size?

asked Oct 14, 2015 in System Integration by Customer
Our current project will reach the limit of the available code size soon. Of course, we can optimize the C-code (middleware) of our project - but we are looking for some hints to reduce the resulting code size of our EmWi project.

1 Answer

+1 vote
answered Oct 21, 2015 by EmWi Support

The following list contains the most efficient tips to save code size in your Embedded Wizard UI application.

  • Avoid the usage of big bitmap resources.
  • Reduce the font range to the necessary limit. By using the Excel sheet template for managing your strings, you can extract the used character codes of your strings in order to define the minimum range.
  • Don’t use too many different fonts and font sizes. Each font brick in your project causes Embedded Wizard to generate an extra set of glyphs.
  • If possible, reduce the font quality. Even if the glyphs are compressed in the code, 'High' font quality generates glyphs with 4 bits per pixel, 'Medium' 2 bits per pixel and 'Low' generates glyphs with 1 bit per pixel.
  • Set the attribute 'Optimization' in your profile to 'High'. Dependent on the optimization level, Embedded Wizard suppresses the code generation for unused resources, classes, constants methods and variables. For any members, referenced only from outside (e.g.: the application class) you need to set the attribute 'Generator' to 'true' to avoid the optimization of the corresponding code.
  • Optimal use of the inheritance in your class hierarchy.
  • Merge similar icons/images to a single file. By this way Embedded Wizard can reach a higher compression with the resource converter and you can easily access such an image frame by setting the attribute 'FrameSize' and select a frame number by the property 'FrameNumber' in your Views::Image or Views::Frame object.

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint