What does the CapInsets property of a FireMonkey TBitmapLink do for a FireMonkey style?

281 views Asked by At

When creating a custom FireMonkey style, you often run into style objects, such as TButtonStyleObject, that include one or more properties (such as TButtonStyleObject.NormalLink) that are collections of TBitmapLinks. Each individual TBitmapLink defines three properties, CapInsets, Scale, and SourceRect. SourceRect contains the coordinates of a segment of a bitmap that will be used to draw some aspect of the control (see Using TBitmapLinks with the FireMonkey Style Designer for more detail).

My question is, what does CapInsets do?

1

There are 1 answers

0
AndreaMagni On BEST ANSWER

I think it is something related how to paint a resizable component using a single bitmap. The CapInsets should represent the stretchable portion of the bitmap leaving apart, in example, the borders so they do not get too thin or too large when you resize the component.

Think about a button and a 25x50 px bitmap to be the backround. Think it is a single color rectangle with a little border. What if you resize the button to be 25x500 px? The left and right border will become too large (and no more proportional to the top and bottom border).

I found no documentation except this article in russian (translation to italian is very bad, the english one isn't so clear to me as well), look for the "Background" section http://habrahabr.ru/post/137851/

HTH