Appendix
Displaying Bitmaps/Icons  
  Using the following techniques in ProvideX, you can retrieve and incorporate bitmaps and icons for a variety of uses in your GUI-based applications:

• Display images via the 'PICTURE' mnemonic.
• Associate images for GUI controls using the control object directives BUTTON, CHECK_BOX, LIST_BOX, RADIO_BUTTON, TRISTATE_BOX, MENU_BAR, POPUP_MENU.  
• Specify icons to customize the upper left corner of dialogue windows via the 'OPTION' mnemonic or the ICON= INI file setting.

  Also, the NOMADS toolset provides a fully-integrated development environment for creating and modifying graphical screen layouts. For more information on handling images in NOMADS, refer to the ProvideX NOMADS Reference.

This section discusses some the general concepts and ProvideX functionality involving the use of images in ProvideX applications.

   
Internal vs External Images Images are recognised as internal in ProvideX if they have a leading exclamation mark (!) in their filenames;

PRINT 'PICTURE'(220,210,600,500,"!Binoculars",2)

Internal images can be accessed if they are embedded within the ProvideX executable itself, supplied in an associated resource library, or exist in a file located in the *BMP directory. All internal images have an implied light gray transparency.

Use the 'PICTURE' mnemonic to return a list of available internal images (including the set of standard OS icons).

For example:

X$='PICTURE'(*)
PRINT X$

To access images that are external to ProvideX, specify the path and filename instead of the exclamation mark; e.g.,

PRINT 'PICTURE'(1,1,100,100,"C:\WINDOWS\CLOUDS.BMP,T",0)

   
Recognized File Types By default, only bitmap (bmp) or icon (ico) file types are supported automatically in ProvideX. By installing the Multiple Image Type add-on, you can extend graphic image support to include other file types such as jpg, tiff, png, pcx, pax, wmf, emf, apm, and tga.
   
Enhanced Icons As of Version 6, ProvideX is able to use ico files that contain multiple icons, different sizes, and different colour formats. Icons can also be retrieved from other file types, including .exe, .dll, .ocx, .drv, .cpl, .scr and .icl (icon libraries). The file types are described below.

The following optional syntax items may be applied in the 'PICTURE' and 'OPTION' mnemonics, as well as in control object directives, to define the location and attributes of an icon to be retrieved from an enhanced icon source:

[filename] [@resourcename | @resourcenum] [%Size] [,T | ,G | ,N ]

Where:

filename File containing icon(s). If no filename is given, then the currently loaded resource library is searched.
@resourcename String name of the specific resource identifying the icon. If no resource is specified, the first icon in the file will be loaded.
@resourcenum Specific resource number identifying the icon. If no resource is specified, the first icon in the file will be loaded.
%size 1 to 3-digit number of pixels representing the X or Y size of the icon displayed. This size is used for both X and Y axes; e.g., %16 displays the icon in 16 x 16 pixels.
  If no %size is given, then the first format available for the icon is used. If %0 is specified, then the default OS icon size is used.
T, G or N Transparency substitution indicator where (can also be applied to internal images):
- T means use upper left most pixel colour
- G means use light gray colour RGB: 192,192,192
- N means no transparency (allows override for "!" bitmaps which always imply Light gray transparency)


*Note* Syntax options (if applied) must appear in the above defined order. Also note the T,G, or N options can be applied to internal bitmaps (those prefixed with "!").


  Standard ProvideX search rules apply to the filenames. A leading exclamation will also search the *BMP directory. Colour depth selection (16, 256 or 24-bit) is chosen automatically by the OS based on the user's current video card colour depth and the colour depth of the icon available within the file.

Examples:

C:\Pvx\Pvx.ico%16,T C:\Windows\System32\Shell32.dll@137%32,T C:\Windows\System32\Shell32.dll@137%32,T
!myico.ico%48
!myico.ico%48,G
@ProvideX,T
<path>\pvxwin32.exe@ProvideX%16,T

Icon File Types

ProvideX accepts icons from the following file extensions:

File Suffix Description
.ico Does not support loading by resource name / resource number. You must specify the filename (with or without path), ending in .ICO.
.exe, .dll, .ocx, .drv, .cpl, .scr (Any file type that the MS Windows API allows a LoadImage from).
You must specify a resource name or number.
.icl Icon Library (commonly used by Icon editing tools). You must specify a resource number only (0 based). It ignores icon size specifications. If you intend to use icons from a .ICL, we recommend that you convert it to a DLL so that you may take advantage of any size specifications.
  Enhanced Icons in INI Files

The [Config] section of your INI file, allows for an ICON= using any of the above syntax for specifying the icon. If no filename is given or there is no leading @ sign, then the name given is assumed to be a resource name from either the currently loaded resource library (if any) or from the ProvideX executable; e.g.,

[Config]
Icon=myname ! Would be the icon "myname" in a resource library
Icon=@myname ! Same as above
Icon=mydll.dll@myapp



*Note* Specifying an icon in a INI file can impact your user license count for ProvideX, as the icon name will be used for the Window Class Name, and ProvideX sessions with different Class Names do not share their user licenses.


  Enhanced Icons in Objects

When using enhanced icons in objects, the filename and syntax must be enclosed in curly braces; e.g.,

BUTTON 10,@(40,2,8,3)="{pvxwin32.exe@ProvideX%32,T}" BUTTON 10,@(40,2,10,2)="{@90w%32,T}"



*Note* Transparency effects are currently not supported in menus or popup menus.