Ignore:
Timestamp:
Mar 9, 2021, 9:13:07 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Better scaled bitmaps drawing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Packages/DpiControls/UDpiControls.pas

    r303 r308  
    99  Controls, StdCtrls, fgl, Graphics, ComCtrls, ExtCtrls, LCLType, GraphType,
    1010  Types, CustApp, LMessages, LCLIntf, Menus, Math, UPixelPointer2;
     11
     12const
     13  FixedDpi = -1;
    1114
    1215type
     
    10711074function ScaleToNative(Value: Integer): Integer;
    10721075begin
    1073   Result := Round(Value * DpiScreen.Dpi / 96);
     1076  Result := Trunc(Value * DpiScreen.Dpi / 96);
    10741077end;
    10751078
     
    30683071procedure TDpiScreen.UpdateScreen;
    30693072begin
    3070   Dpi := Screen.PixelsPerInch;
     3073  if FixedDpi = -1 then Dpi := Screen.PixelsPerInch
     3074    else Dpi := FixedDpi;
    30713075end;
    30723076
Note: See TracChangeset for help on using the changeset viewer.