function InitializeBitmapImageFromIcon(const BitmapImage: TBitmapImage; const IconFilename: String; const BkColor: TColor; const AscendingTrySizes: TArrayOfInteger): Boolean;
Initializes the given bitmap image with an icon from the given icon file using the given background color for transparent parts.
The bitmap image should be scaled already and the function will load the largest fitting icon which has a size from the given array of sizes. After loading the function will set the size of the bitmap image to the loaded size.
The array must be sorted already from smallest to highest size.
If no match is found in the array (for example, because it is empty), the minimum of the bitmap image's width and height will be used as the size.
Returns True if the icon could be loaded, False otherwise.
procedure InitializeWizard;
var
Page: TWizardPage;
BitmapImage: TBitmapImage;
begin
Page := CreateCustomPage(wpWelcome, 'Test', 'Test');
BitmapImage := TBitmapImage.Create(Page);
with BitmapImage do begin
Width := ScaleX(32);
Height := ScaleY(32);
Parent := Page.Surface;
end;
InitializeBitmapImageFromIcon(BitmapImage, 'MyProg.ico', clNone, [32, 48, 64]);
end;