[TBitmapImage在Inno Setup 6中按比例显示时大于其大小

问题描述 投票:0回答:1

仅更新至最新的Inno Setup v.6.3.3。但是现在我的TBitmapImage图像中出现白色边框。下面的脚本在旧版本5上运行良好。

所以,多年来使用的较新版本和脚本似乎出了什么问题?

[请注意,我已将显示比例缩放到了125%。

ExtractTemporaryFile(ExpandConstant( '{#BackgroundImage}' ));
BackgroundBitmapImage := TBitmapImage.Create(MainForm);
BackgroundBitmapImage.Left := 0;
BackgroundBitmapImage.Top := 50;
BackgroundBitmapImage.AutoSize := True;
BackgroundBitmapImage.Bitmap.LoadFromFile( ExpandConstant('{tmp}\{#BackgroundImage}')  );
BackgroundBitmapImage.Parent := MainForm;

enter image description here

图像的确切大小都无法解决问题。

ExtractTemporaryFile(ExpandConstant( '{#BackgroundImage}' ));
BackgroundBitmapImage := TBitmapImage.Create(MainForm);
BackgroundBitmapImage.Left := 0;
BackgroundBitmapImage.Top := 50;
BackgroundBitmapImage.Width := 600;
BackgroundBitmapImage.Height := 500;
BackgroundBitmapImage.AutoSize := False;
BackgroundBitmapImage.Bitmap.LoadFromFile( ExpandConstant('{tmp}\{#BackgroundImage}')  );
BackgroundBitmapImage.Parent := MainForm;
image border inno-setup pascalscript
1个回答
0
投票

缩放MainForm窗口所在的显示,缩放/缩放。

设置.Parent时,控件将重新缩放为目标显示。为防止这种情况,请在(隐式)设置尺寸之前设置.Parent

ExtractTemporaryFile('{#BackgroundImage}');
BackgroundBitmapImage := TBitmapImage.Create(MainForm);
BackgroundBitmapImage.Parent := MainForm;
BackgroundBitmapImage.Left := 0;
BackgroundBitmapImage.Top := 50;
BackgroundBitmapImage.AutoSize := True;
BackgroundBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\{#BackgroundImage}'));

请注意,不需要为ExpandConstant调用'{#BackgroundImage}',因为它是does not contain any constant

© www.soinside.com 2019 - 2024. All rights reserved.