To define areas within a control the GUI-Library is using margins. The Margins are used in the skin definitions. Currently we have four different type of margins:

1. Offset margins

This margins are used to calculate the DisplayRectangle of the control. The DisplayRectangle the region which are drawable by child controls. A window widget is a good example. The DisplayRectangle is the area of the window you get, if you cut off the window borders, the title area and the scrollbars.

2. Resize margins

The resize margins are used for resizing controls. It is a margin at the four borders which are sensitive for resizing operations. This is used mainly by windows.

3. Tile margins

This is used for rendering resized controls. In the skin image you have a fixed sized control of a button e.g. This image is cutted into nine parts (top left, top, top right, left, center, right, bottom left, bottom and bottom right) by making two horizontal and two vertical cuts. Only the center tile is streched, the border tiles are fixed size to avoid ugly effects when resizing widgets. The button widget is a good example for this behaviour.

4. Content margins

This margins are the same as the Offset margins but are used for drawing and scissoring.

Last edited May 2, 2011 at 12:11 PM by Glatzemann, version 1


No comments yet.