Reputation: 309
I want to show it on the welcome page.
How is that possible?
Upvotes: 5
Views: 4718
Reputation: 5456
In 5.5.7 update (28th December 2015) there was 32bit BMP with Alpha Channel function implemented.
The WizardImageFile and
WizardSmallImageFile
[Setup]
section directives now support 32 bit bitmap files with an alpha channel. Use the newWizardImageAlphaFormat
[Setup]
section directive to specify if the bitmap file has its red, green and blue channel values premultiplied with the alpha channel value or not. Contributed by Honza Rameš via GitHub.
and
Pascal Scripting changes:
ClassTBitmapImage
now supports 32 bit bitmap files with an alpha channel. Make sure to set theBitmap.AlphaFormat
property before loading the bitmap file.
http://www.jrsoftware.org/files/is5-whatsnew.htm
Upvotes: 7
Reputation: 3055
However, there is a workaround if your intention is mainly to show a partially transparent image:
the ReplaceColor
and ReplaceWithColor
properties of the TBitmapImage
class allow replacing a color in the image with another color dynamically. The trick is to replace a "dummy" color (e.g. magenta) with the background color of the wizzard:
#FF00FF
)Include the image in your ISS:
[Files]
Source: "my\transparent\image.bmp"; DestDir: "{tmp}"; Flags: dontcopy
Add the image to the wizzard page:
[Code]
procedure InitializeWizard;
var
ImageFile: String;
Image: TBitmapImage;
begin
ImageFile := ExpandConstant('{tmp}\image.bmp');
ExtractTemporaryFile('image.bmp');
Image := TBitmapImage.Create(WizardForm);
with Image do
begin
Bitmap.LoadFromFile(ImageFile);
Parent := WizardForm.WelcomePage;
Left := 10;
Top := 10;
Width := 30;
Height := 30;
ReplaceColor := $00FF00FF; // Replace magenta...
ReplaceWithColor := WizardForm.WelcomePage.Color; // ...with the background color of the page
end;
end;
It is not as pretty as a real alpha transparency but should be fine for simple cases.
Upvotes: 6
Reputation: 9192
According to the newsgroup posting at http://news.jrsoftware.org/news/innosetup.code/msg23217.html, PNGs are not supported on Setup Forms and would also be unsupported on the Welcome Page.
Upvotes: 6