393 views
in GUI Development by

Hi,

I meet a trouble when I create a component, I made a small sample as following link.

http://ask.embedded-wizard.de/?qa=blob&qa_blobid=6987963082435417390

Please open Project > Example > Component, and you will see a "white block" draw on a "SteelPanelBackground", the "white block" draw by 4 lines (Views::Line) and width is 2 pixels.

Please take care each bottum side of all "vertical line", you will find the width of line is abnormal. You can refer following picture for catch my meaning. Please help me for fix this trouble and let me know the cause, thank you.

1 Answer

0 votes
by
 
Best answer

With the line view you can specify different width of the line at its start and its end position. This is exact the problem with the vertical line in your example. The width at the upper point is 2. The width at the bottom point is 1. This causes the line to shrink from 2 to 1 pixel. Set the both properties Width1 and Width2 of the line view to the same value to avoid such errors.

Some internal beackgrounds: lines with thickness > 1 px are drawn as filled quad areas. In other words the Graphics Engine treates the line as a polygon with four corners, calculates the coordinates of the four conrers and fills it with a solid color. Edges of such polygon are drawn antialiased. This may cause the pixel at the edge to appear semitrasparent. The thin the line the more impact can the antialiasing have. This was the effect at the bottom edge in your example.

If you want a rectangular border to be drawn I would suggest to use the border view instead of to compose the border of separate line segments. If you want a simple vertical or horizontal bar (or line) be drawn it is also recommended to use the rectangle view instead of the line. The line view is less efficient when used to draw a line with thickness > 1. The best is to use line views only when you want an inclined line to be drawn.

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

...