Page tree
Skip to end of metadata
Go to start of metadata

Description

The Bitmap resource requires either a 24 bit png file with alpha channel or a bmp file without alpha channel. Many elements refer to bitmap resources, which can be assigned once a resource has been created. Keep in mind that each individual image is managed by the OS and costs performance. Therefore, it is recommended to work with a lower number of images, create sections within these images and use the sections wherever an image resource is required. In this case, HALion's GUI framework handles the section resources and the OS only has to deal with a few images.

 

On this page:

Properties

PropertyDescription
Name

The name of the Bitmap resource.

PathSpecifies the path and file name of the used bitmap.
Alpha
Defines the opacity of the bitmap from 0 (transparent)  to 255 (opaque).
FramesDefines the number of subframes in a bitmap. Bitmaps with frames can be used as animations in controls like knobs, sliders, and animations.
Scale Mode

This mode defines how a bitmap is adapted in size when the control that is using it is set to be 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 control size exceeds the size of the original bitmap.
  • Tile Border: This method only draws the area defined by the margin settings repeatedly and leaves the inner area empty.
Margin

Left, 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.

On Windows systems, the maximum size for bitmaps is 2048 x 16384 pixels. Note that this refers to the bitmap size in memory rather than to the absolute size of the bitmap file.
When loading a bitmap, a rescaled version of the bitmap resource is automatically created in memory. The size of the bitmap resource depends on the display scaling factor.

For example, if you use a scaling factor of 200 %, the size of the bitmap resource will be twice the original file size. This higher-resolution bitmap resource will then use either an upscaled version of the bitmap file or an additional High-DPI version of it.
In other words, a standard bitmap should have a maximum width of 1024 and height of 8192 pixels, to allow for a scaling factor of 200%.

If you want to leave headroom for higher display scaling factors like 300%, for example, you must reduce the maximum size of the bitmaps to approx. 680 x 5460 pixels.

Especially with animations that contain a large number of frames, a height of 8192 pixels is easily reached. So be careful when creating animations for large objects.

 

Example:

A knob with 50 x 50 pixel frame size and 100 frames will lead to a bitmap of 50 x 5000 pixels.
The High-DPI version of this knob will have a size of 100 x 10.000 pixels, which would be too large for a scaling factor of 200 %.
Decreasing the number of frames to 65, as it is the case for most of the HALion factory controls, reduces the size to 50 x 3250
in standard and 100 x 6500 in High DPI resolution.

  • No labels

2 Comments

  1. one typo, one line break corrected