WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStFactory class reference

LoadExternalIcon

Call this method to load a pair of icons (Whose sizes must be 32x32 and 16x16 pixels or 64x64 and 32x32 for HDPI displays) from a dynamic link library (Dll) or a single icon from a image file. The loaded icon can be referenced later by it's id and can be displayed by several widgets such as: WS_BUTTON, WS_MENU and WS_LIST_CTRL.

Ole declaration

VARIANT_BOOL LoadExternalIcon(SHORT usIconId, SHORT usIconIndex, LPCTSTR sFilePath);

Parameters
usIconId
The id of the icon.
usIconIndex
Raw index of the icon in the Dll. Use 0 if the icons is going to be loaded from a image
sFilePath
The dll or image file where the icon will be extracted from.
Return Value

On success, LoadExternalIcon returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.

Remarks

Every time this method is called, a transaction is sent to the mobile unit, so the load of multiple icons can take a few seconds.

WireLess Studio includes a built-in icon library: IconLib.dll. The icons that can be extracted from this file are described here.

The supported image formats are BMP, JPEG and PNG.

Example
C#
using WirelessStudioOleWidgets;
WStFactory oFactory = new WStFactory();
oFactory.LoadExternalIcon(44, (short)WSIcons.WS_WRITE, "IconLib.dll");
Visual Basic 6 (Full Example: BasicPropertiesDemoModule.bas.txt)
Public wsForm As New WStForm
Public wsFactory As New WStFactory		
...
'Widgets customization
'Exit icon
wsFactory.LoadExternalIcon 4, WS_EXIT, "IconLib.dll"
'Reset icon
wsFactory.LoadExternalIcon 3, WS_RELOAD, "IconLib.dll"
...
See also

WStWidget::SetIcon | WStWidget::SetRowIcon | WStWidget::AddOption | WStWidget::AddRow

WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference