Ignore:
Timestamp:
May 7, 2020, 7:05:57 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Improved code in HighDPI branch.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Start.pas

    r179 r193  
    256256    end; // default AI not found, use any
    257257
    258   DirectDlg.Left := (Screen.Width - DirectDlg.Width) div 2;
    259   DirectDlg.Top := (Screen.Height - DirectDlg.Height) div 2;
     258  DirectDlg.Left := (DpiScreen.Width - DirectDlg.Width) div 2;
     259  DirectDlg.Top := (DpiScreen.Height - DirectDlg.Height) div 2;
    260260
    261261  if FullScreen then
    262262  begin
    263     Location := Point((Screen.Width - 800) * 3 div 8,
    264       Screen.Height - Height - (Screen.Height - 600) div 3);
     263    Location := Point((DpiScreen.Width - 800) * 3 div 8,
     264      DpiScreen.Height - Height - (DpiScreen.Height - 600) div 3);
    265265    Left := Location.X;
    266266    Top := Location.Y;
     
    279279  else
    280280  begin
    281     Left := (Screen.Width - Width) div 2;
    282     Top := (Screen.Height - Height) div 2;
     281    Left := (DpiScreen.Width - Width) div 2;
     282    Top := (DpiScreen.Height - Height) div 2;
    283283  end;
    284284
     
    611611          h := ClientHeight - ActionBottomBorder -
    612612            (yAction + SelectedAction * ActionPitch - 8);
    613         BitBltCanvas(LogoBuffer.Canvas, 0, 0, w, h, Canvas,
     613        //BitBltCanvas(LogoBuffer.Canvas, 0, 0, w, h, Canvas,
     614        //  ActionSideBorder + i * wBuffer, yAction + SelectedAction * ActionPitch
     615        //  - 8, SRCCOPY);
     616        BitBlt(LogoBuffer.Canvas.Handle, 0, 0, w, h, Canvas.Handle,
    614617          ActionSideBorder + i * wBuffer, yAction + SelectedAction * ActionPitch
    615618          - 8, SRCCOPY);
     
    879882  EmptyPicture.BeginUpdate;
    880883  PicturePixel.Init(EmptyPicture);
    881   for y := 0 to 63 do begin
    882     for x := 0 to 64 - 1 do begin
     884  for y := 0 to ScaleToVcl(64) - 1 do begin
     885    for x := 0 to ScaleToVcl(64) - 1 do begin
    883886      PicturePixel.Pixel^.B := Max(PicturePixel.Pixel^.B - 28, 0);
    884887      PicturePixel.Pixel^.G := Max(PicturePixel.Pixel^.G - 28, 0);
     
    10491052  Mini.BeginUpdate;
    10501053  MiniPixel.Init(Mini);
    1051   for y := 0 to MiniHeight - 1 do begin
    1052     for x := 0 to MiniWidth - 1 do begin
     1054  for y := 0 to ScaleToVcl(MiniHeight) - 1 do begin
     1055    for x := 0 to ScaleToVcl(MiniWidth) - 1 do begin
    10531056      for i := 0 to 1 do begin
    1054         xm := (x * 2 + i + y and 1) mod (MiniWidth * 2);
     1057        xm := (x * 2 + i + y and 1) mod (ScaleToVcl(MiniWidth) * 2);
    10551058        MiniPixel.SetX(xm);
    10561059        cm := MiniColors
Note: See TracChangeset for help on using the changeset viewer.