Blitz3D+ Command Reference

LoadIconStrip ( file$ )

Parameters

file$ - path of the image file containing the icon strip

Description

Loads a horizontal strip of square icons for toolbars, item icons and buttons.

An icon strip is a single image holding a row of equal-sized square cells: icon 0 on the left, icon 1 next to it, and so on. The image width must be an exact multiple of its height, or the load stops with a runtime error. Classic BlitzPlus BMP strips work unchanged, and any format Windows can decode (PNG, JPEG, GIF, TIFF) loads too.

The colour of the top-left pixel is treated as the transparent colour. A cell filled entirely with that colour counts as a blank icon - in a toolbar, blank icons become separator gaps between buttons. Buttons also keep the soft edges of an image with an alpha channel, such as a transparent PNG.

The returned handle is a positive, type-checked id. Attach it to a toolbar, combo box, list box, tree view or tabber with SetGadgetIconStrip; items then refer to icons by their cell index. A push button shows one icon, chosen with SetButtonIcon. Gadgets take their own copy of the strip, so it is safe to call FreeIconStrip as soon as every gadget that needs it has been given it.

Tip: for a toolbar you usually do not need this command at all - CreateToolBar with an empty icon path supplies a built-in strip of standard editor icons.

Requires Extended mode.

See also: FreeIconStrip, SetGadgetIconStrip, SetButtonIcon, CreateToolBar, AddGadgetItem, AddTreeViewNode.

Index