仅更新至最新的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;
图像的确切大小都无法解决问题。
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;
缩放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。