12 views
in GUI Development by
Hi There,

I've noticed that Resources::WhiteBitmap uses 65536 bytes of program memory, yet it is highly (highly!) compressible data. It's so compressible that I think run length encoding of the data would save about 50k. It looks to be an integral part of the Mosaic framework, so I think it would be unwise to remove it, is there a way that I can avoid such a waste of program memory?

I'm using EW 8.30

Kind Regards,

Rob

1 Answer

0 votes
by

Hello Rob,

you can try to replace the original PNG file WhiteBitmap.png found in the folder Mosaic\Res just below the installation directory by a smaller version, e.g. 32x32 pixel large. This should reduce the resulting memory footprint to ~1kB. From technical point of view, this bitmap is used by internal Mosaic drawing operations FillPolygon() and DrawThickLine(). For example, DrawThickLine() will be used when you display a thick straight line segment (see Specify the width of the Line view). The resolution of 256 is necessary when the drawing operation is performed with a linear color gradient. Lower values would result in a roughly looking gradient.

The bitmap allows a kind of trick to draw simple quad shaped polygons before we added the support for real vector graphic operations. For compatibility purpose, however, the mentioned old operations (FillPolygon and DrawThickLine) still have to depend on this bitmap. With the version 9.20 we changed DrawThickLine() method to use a smaller (256x4 large) bitmap for drawing line segments, what produces the same results. The old FillPolygon() method depends still on the 256x256 large bitmap. Generally, when the mentioned drawing operations are not used in your project, the bitmaps should be ignored during the code generation phase.

The simplest would be to try to replace the image file by a smaller version and test you application again. Or you update to the current version 9.30.

I hope the above explanation helps you to understand the technical backgrounds.

Best regards

Paul Banach

by
Super, thank you Paul :-)

Kind Regards,

Rob

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

...