Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 17-08-2024, 03:21
Lord.Freddy's Avatar
Lord.Freddy Lord.Freddy is offline
Registered User
 
Join Date: Apr 2022
Location: ...
Posts: 54
Thanks: 222
Thanked 41 Times in 25 Posts
Lord.Freddy is on a distinguished road
Quote:
Originally Posted by Cesar82 View Post
Thanks for the support...
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.
How about this?, This works perfectly for me.
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 ¤
Reply With Quote
Sponsored Links
Reply

Tags
cls-diskspan, compressor, diskspan, diskspan_gui


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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



All times are GMT -7. The time now is 09:52.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com