Changeset 17 for trunk/Forms


Ignore:
Timestamp:
Jan 21, 2018, 10:01:14 PM (7 years ago)
Author:
chronos
Message:
  • Added: Resize virtual screen according form size.
Location:
trunk/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r14 r17  
    55  Width = 932
    66  Caption = 'Screen 1 - ChronOS'
    7   ClientHeight = 656
     7  ClientHeight = 653
    88  ClientWidth = 932
    99  Menu = MainMenu1
     
    1616  object PaintBox1: TPaintBox
    1717    Left = 0
    18     Height = 656
     18    Height = 653
    1919    Top = 0
    2020    Width = 932
  • trunk/Forms/UFormMain.pas

    r15 r17  
    9292  VideoDevice.OnRedraw := VideoDeviceRedraw;
    9393  VideoDevice.DPI := Screen.PixelsPerInch;
    94   VideoDevice.VideoMemorySize := TPoint.Create(PaintBox1.Width, PaintBox1.Height);
    9594  VideoDevice.OnModeChanged := VideoDeviceRedraw;
     95  PaintBox1Resize(Self);
    9696  Kernel.Devices.Add(VideoDevice);
    9797
     
    215215
    216216procedure TFormMain.PaintBox1Resize(Sender: TObject);
    217 begin
     217var
     218  VideoMode: TVideoMode;
     219begin
     220  VideoMode := TVideoMode.Create;
     221  VideoMode.Assign(VideoDevice.VideoMode);
     222  VideoMode.Size := TPoint.Create(Width, Height);
     223  VideoDevice.VideoMode := VideoMode;
    218224end;
    219225
Note: See TracChangeset for help on using the changeset viewer.