IDE: High-dpi logo in splash and about forms, by Roland Hahn.

git-svn-id: trunk@63774 -
This commit is contained in:
wp 2020-08-17 21:50:59 +00:00
parent 8386c71041
commit ddd10328bd
5 changed files with 8 additions and 28 deletions

View File

@ -243,8 +243,8 @@ object AboutForm: TAboutForm
AnchorSideBottom.Control = CloseButton AnchorSideBottom.Control = CloseButton
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 6 Left = 6
Height = 29 Height = 26
Top = 11 Top = 12
Width = 30 Width = 30
Anchors = [akTop, akLeft, akBottom] Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Left = 6 BorderSpacing.Left = 6
@ -252,8 +252,8 @@ object AboutForm: TAboutForm
end end
end end
object PopupMenu1: TPopupMenu object PopupMenu1: TPopupMenu
left = 76 Left = 76
top = 278 Top = 278
object miVerToClipboard: TMenuItem object miVerToClipboard: TMenuItem
Caption = 'Copy version information to clipboard' Caption = 'Copy version information to clipboard'
OnClick = miVerToClipboardClick OnClick = miVerToClipboardClick

View File

@ -307,20 +307,9 @@ begin
end; end;
procedure TAboutForm.LoadLogo; procedure TAboutForm.LoadLogo;
var
pic: TPicture;
W, H: Integer;
begin begin
pic := TPicture.Create; LogoImage.Picture.LoadFromResourceName(HInstance, 'splash_logo', TPortableNetworkGraphic);
try ScaleImg(LogoImage.Picture.Bitmap, LogoImage.Width, LogoImage.Height)
pic.LoadFromResourceName(hInstance, 'splash_logo', TPortableNetworkGraphic);
W := LogoImage.Width;
H := LogoImage.Height;
LogoImage.Picture.Bitmap.SetSize(W, H);
AntiAliasedStretchDrawBitmap(pic.Bitmap, LogoImage.Picture.Bitmap, W, H);
finally
pic.Free;
end;
end; end;

View File

@ -124,18 +124,8 @@ begin
end; end;
procedure TSplashForm.LoadSplash; procedure TSplashForm.LoadSplash;
var
pic: TPicture;
begin begin
pic := TPicture.Create; Image.Picture.LoadFromResourceName(hInstance, 'splash_logo', TPortableNetworkGraphic);
try
pic.LoadFromResourceName(hInstance, 'splash_logo', TPortableNetworkGraphic);
Width := round(Height * pic.Width / pic.Height);
Image.Picture.Bitmap.SetSize(Width, Height);
AntiAliasedStretchDrawBitmap(pic.Bitmap, Image.Picture.Bitmap, Width, Height);
finally
pic.Free;
end;
end; end;
procedure TSplashForm.Show; procedure TSplashForm.Show;
@ -143,6 +133,7 @@ begin
inherited; inherited;
LoadSplash; LoadSplash;
ScaleImg(Image.Picture.Bitmap, Width, Height);
end; end;
end. end.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.