但是,如果您的主要目的是显示部分透明的图像,则有一种解决方法:
类的ReplaceColor和ReplaceWithColor属性TBitmapImage允许动态地用另一种颜色替换图像中的一种颜色。诀窍是用向导的背景颜色替换“虚拟”颜色(例如洋红色):
#FF00FF)将图像包含在您的 ISS 中:
[Files]
Source: "my\transparent\image.bmp"; DestDir: "{tmp}"; Flags: dontcopy
Run Code Online (Sandbox Code Playgroud)将图像添加到向导页面:
[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;
Run Code Online (Sandbox Code Playgroud)它不像真正的 alpha 透明度那么漂亮,但对于简单的情况应该没问题。
在5.5.7更新(2015年12月28日)中,实现了具有Alpha通道功能的32位BMP。
WizardImageFile和
WizardSmallImageFile[Setup]section指令现在支持带有alpha通道的32位位图文件。使用newWizardImageAlphaFormat[Setup]section指令指定位图文件的红色,绿色和蓝色通道值是否预先与alpha通道值相乘。由HonzaRameš通过GitHub提供。
和
Pascal脚本更改:
类TBitmapImage现在支持带有alpha通道的32位位图文件。确保Bitmap.AlphaFormat在加载位图文件之前设置属性。
http://www.jrsoftware.org/files/is5-whatsnew.htm
| 归档时间: |
|
| 查看次数: |
2874 次 |
| 最近记录: |