Sfairadora

  • Reference Guide

icon

icon(dx, dy)
icon(dx, dy, src1)
icon(dx, dy, src1, rsrc1)
icon(dx, dy, src1, src2)
icon(dx, dy, src1, rsrc1, src2, rsrc2)
Creates an icon (a value of the type Icon) according to the specified parameters. The icon has fixed size specified by the parameters dx and dy. The size is specified in pixels.
An icon can contain one or two images. If two images are present and the icon is used for example in a button or a check button, the alternative image is used when the button is pressed or the check button is checked.
The image is specified by the parameter src1 (and possibly src2). The image can be of the type Bitmap, then it specifies immediately the image to be displayed, or it can be of the type String. In the latter case, the parameter specifies the file name, where is the icon stored. The file can be either an icon file (a file with the .ico extension) or any other file containing the icon in its resources – for instance, an .exe or .dll file. In this case, it is necessary to specify the number or name of the resource using the rsrc1 (and possibly rsrc2) parameter. These parameters can be of the type Word (a resource number), String (a resource name), or None (the constant NONE), when the resource does not need to be specified. If the src parameter is an empty string and rsrc is NONE, the icon will be empty.
If the image specified for the icon has a different size than specified by the dx and dy parameters, its size is stretched or shrunk to fit to the desired dimension.

See Also