Function | Package: cg | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 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-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version