Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version

## extract-icon-from-file

Arguments: filename &optional (icon-number 0)size

Returns an icon handle, which can be used as the icon of a window, the value of a `static-picture` control, or the title of a `picture-button` control.

The arguments are:

- filename, which must be a string indicating a file with a .ico, .dll, or .exe extension; an icon is loaded from this file.
- icon-number, which is used for files containing multiple icons; its value should be a non-negative integer indicating the index of the icon to load, where zero indicates the first icon in the file; defaults to zero.
- size, which is a keyword or `nil` that specifies whether to extract a large or small icon. If `:large`, then a large icon is returned if the file contains one, and otherwise `nil` is returned. If `:small`, then a small icon is returned if the file contains one, and otherwise `nil` is returned. If `nil` (the default), then a large icon is returned if the file contains one, and otherwise a small icon is returned.

  A note about small icons in Windows: If an icon file in Windows contains only a small icon, and the size argument is `nil`, then the small icon will be returned, but will be stretched to the large icon size. Therefore, to extract a small icon at its natural size in Windows, you must pass size as `:small`.

See cg-icons.htm.

### GTK Note

Common Graphics icons on GTK are actually the same as pixmaps, and extract-icon-from-file works on the same kinds of files as load-pixmap. The icon-number and size arguments are ignored. The returned integer is a pixmap handle.

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version