/ HALion Developer Resource / HALion Macro Page / Resources /

Section

Description

A section is a portion of a bitmap defined by a rectangle that has a x/y-position, a width and a height.

A section can be used instead of an image resource and has the advantage to use less OS graphic resources. Therefore, it is useful to add only a few image resources combining graphical elements, which are then used as references in the various sections.

Sections can also be used for animations, by setting the Frames property to the number of subframes that can be found within the section. Furthermore, sections can be scaled by the controls in which they are assigned. Select the Scale Mode and Margins to define the scaling behavior.

Properties

PopertyDescription
NameThe name of the section.
Pos XThe x-coordinate of the first pixel (upper left corner).
Pos YThe y-coordinate of the first pixel (upper left corner).
WidthThe horizontal size in pixels.
HeightThe vertical size in pixels.
FramesDefines the number of subframes in a bitmap. Bitmaps with frames can be used as animations in controls like knobs, sliders, and animations.
Scale ModeThis mode defines how a bitmap is adapted in size when the control that is using it is set to Scalable and sized smaller or larger than the original bitmap.
  • Stretch: By default, scale mode is set to stretch, which means that the bitmap is drawn smaller or larger.
  • Tile: This means that the original bitmap will be drawn repeatedly as soon as the size of the control exceeds the size of the original bitmap.
  • Tile Border: This mode only draws the area defined by the margin settings repeatedly and leaves the inner area empty.
MarginLeft, Top, Right, Bottom: As soon as a margin is set, the margin area is not stretched or tiled, but only the area outside. This can be used to define frames, for example, where the four corners of the bitmap are preserved in size and only the rest of the bitmap is stretched.