|
|
|
#1
|
||||
|
||||
|
Quote:
I've already tested something with custom scale but it doesn't work. It just makes DSG slower than if I use ScaleX and ScaleY to create all the forms. It's not that. The problem is that the DSG was the size of the screen and when applying the 150% scale, for example, it highlights the HEIGHT size of the monitor and is not drawn larger than the monitor's resolution. The same happens with your script, see the attached video. |
| Sponsored Links |
|
#2
|
||||
|
||||
|
Quote:
Code:
#define DEBUG 0
[Setup]
AppName=SimpleForm
AppVerName=SimpleForm
CreateAppDir=no
OutputDir=.\
OutputBaseFilename=SimpleForm_CustomScale
[/Setup]
#Include AddBackslash(SourcePath) + "Module\ISSystemInfoModule.iss"
[_Code]
const
DEFAULT_DPI = 96; // Default DPI (96 DPI is 100%)
function ScaleFontSize(Value: Integer): Integer;
var
CurrentDPI: Integer;
begin
CurrentDPI := GetDisplayVerticalDPI;
Result := Round((((DEFAULT_DPI * 100) div CurrentDPI) * Value) div 100);
end;
function GetTextWidth(aText: String; aFont: TFont): Integer;
var
Bmp: TBitmap;
begin
Bmp := TBitmap.Create;
try
Bmp.Canvas.Font.Assign(aFont);
Result := Bmp.Canvas.TextWidth(aText);
finally
Bmp.Free;
end;
end;
function GetTextHeight(aText: String; aFont: TFont): Integer;
var
Bmp: TBitmap;
begin
Bmp := TBitmap.Create;
try
Bmp.Canvas.Font.Assign(aFont);
Result := Bmp.Canvas.TextHeight(aText);
finally
Bmp.Free;
end;
end;
function InitializeSetup: Boolean;
var
SF: TSetupForm;
SFP: TPanel;
begin
SF := CreateCustomForm;
with SF do
begin
ClientWidth := 1000;
ClientHeight := 1350;
Position := poDesktopCenter;
Caption := 'CustomScale';
BorderStyle := bsSingle;
BorderIcons := [biSystemMenu, biMinimize];
SFP := TPanel.Create(SF);
with SFP do
begin
Parent := SF;
Align := alClient;
BevelInner := bvNone;
BevelOuter := bvNone;
Caption := 'Simple Form';
Font.Style := [fsBold];
Font.Size := ScaleFontSize(26);
TabOrder := 0;
end;
with TLabel.Create(SF) do
begin
Parent := SFP;
AutoSize := False;
Caption := 'Simple Form';
Font.Style := [fsBold];
Font.Size := ScaleFontSize(99);
Width := GetTextWidth(Caption, Font);
Height := GetTextHeight(Caption, Font);
Left := 10;
Top := SF.ClientHeight - Height - Left;
Transparent := False;
Color := clYellow;
end;
ShowModal;
end;
Result := False;
end;
[_/Code]
#if DEBUG
#expr SaveToFile(AddBackslash(SourcePath) + "SimpleForm_PREPROCESSED.iss")
#endif
__________________
¤ Life good be a Dream ¤ |
![]() |
| Tags |
| cls-diskspan, compressor, diskspan, diskspan_gui |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to use diskspan bat | mausschieber | Conversion Tutorials | 13 | 14-01-2026 19:20 |
| DiskSpan on Linux | hydefromt70s | Conversion Tutorials | 1 | 15-10-2020 07:12 |
| DiskSpan FreeArc returns an error | Titeuf | Conversion Tutorials | 2 | 18-07-2020 01:46 |
| CIU 3.0.0.0.u3 (2019-03-28) - Diskspan Issues | mesut28 | Conversion Tutorials | 17 | 30-03-2019 02:28 |
| R.G. Gamers DiskSpan | Simorq | Conversion Tutorials | 1 | 28-10-2017 08:22 |